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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c233446a6027f1ed,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-15 14:51:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!newsfeed.stueberl.de!newsfeed.freenet.de!news.freenet.de!not-for-mail From: Jan Prazak Subject: access / freeing memory Date: Mon, 15 Jul 2002 23:52:57 -0100 Newsgroups: comp.lang.ada Message-ID: User-Agent: Pan/0.11.2 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso885915 Content-Transfer-Encoding: 8bit X-Comment-To: ALL NNTP-Posting-Host: 213.7.190.140 X-Trace: 1026769898 news.freenet.de 23735 213.7.190.140 X-Complaints-To: abuse@freenet.de Xref: archiver1.google.com comp.lang.ada:27123 Date: 2002-07-15T23:52:57-01:00 List-Id: Hello, I have finished reading one Ada tutorial (I won't say that I did understand everything), but the section about "access" was not very clearly explained. Just imagine this simple situation: I have a single-linked list, with a "head". head -> 1 -> 2 -> 3 -> null Is it really possible to say head := null; (to delete all elements) or head.next.next := null; (to delete the 3rd element) or similar things??? This would be a very bad programming technique in Pascal, because this would create a "memory hole". There each element has to be "disposed" with a procedure called "Dispose". The tutorial explains a similar procedure, called Unchecked_Deallocation, but it's said that it's not recommended to use it (because some other access type could access that memory address (that's clear)). So does the operating system take care of the deallocation? And what about other OSs than Linux? Or has this to do with the Ada compiler, which maintains the memory (de)allocation? (This would be more logical.) Thanks, Jan