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,13d6cd0af0d0d769 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-25 08:01:12 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!zombie.ncsc.mil!news.duke.edu!convex!cs.utexas.edu!news.ti.com!news.dseg.ti.com!amber.dseg.ti.com!fjm From: fjm@ti.com (Fred J. McCall) Newsgroups: comp.lang.ada Subject: Re: Does memory leak? Date: Fri, 24 Mar 1995 10:46:20 Organization: Texas Instruments, Inc. Message-ID: References: <3kopao$ekg@nef.ens.fr> NNTP-Posting-Host: amber.dseg.ti.com X-Newsreader: Trumpet for Windows [Version 1.0 Rev A] Date: 1995-03-24T10:46:20+00:00 List-Id: In article mjmeie@ss5.magec.com (Mike Meier) writes: >No, Ada doesn't leak memory. But, some Ada programs (especially >those using C-language X-windows code ;-)) leak memory like a sieve. >In current reality, no Ada run-time environments that I'm aware of provide >automated garbage collection (unless you count deallocation of objects that >fall out of scope), including mainly Alsys and Rational/Verdix. There have >been -long- threads on this subject in this newsgroup in the not too distant >past, and the general consensus seemed to be that garbage collection will >probably not exist in the Ada world soon. >So what do you do? You make sure that you deallocate all dynamically >allocated objects as soon as you're done with them. If the object is >a nested structure containing other dynamically allocated objects, you >deallocate the nested structures first. Note that this is EXACTLY the approach one should be following in C/C++ (and any other language that doesn't take care of garbage collection automagically). So much for the various bashers.