From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c233446a6027f1ed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-16 05:00:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!freenix!jussieu.fr!unilim.fr!news.cict.fr!news.laas.fr!not-for-mail From: Fabien Garcia Newsgroups: comp.lang.ada Subject: Re: access / freeing memory Date: Tue, 16 Jul 2002 13:51:20 +0200 Organization: LAAS-CNRS, Toulouse, France Message-ID: <3D3408B8.4070001@laas.fr> References: <%WHY8.1173$tt5.52024504@newssvr13.news.prodigy.com> NNTP-Posting-Host: pppport14.laas.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: kane.laas.fr 1026820220 16063 140.93.18.115 (16 Jul 2002 11:50:20 GMT) X-Complaints-To: abuse@laas.fr NNTP-Posting-Date: 16 Jul 2002 11:50:20 GMT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: fr-fr Xref: archiver1.google.com comp.lang.ada:27146 Date: 2002-07-16T11:50:20+00:00 List-Id: Jan Prazak wrote: > Let me know if I did understand this correctly: if I have a "head", which > can access nodes (in a list), and I create some nodes and connect > them,for instance: > > head -> 1 -> 2 -> 3 -> null > > and if I do nothing (so the program will end), the operating system (or > compiler???) does the deallocation automatically, just because "head" is > a variable. It then goes, starting at head, through the whole list and > frees the memory occupied by every node. Right? In fact when your program terminates all the memory allocated to the process by the OS is freed. It's not a question of referenced or unreferenced menory. The deallocation doesn't goes "down" your list throught each node, it just erase everything. Hope it will help a bit, sorry for not being able to answer to the others questions (I will be interested by others answer thought :) ) Fabien