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-23 17:57:25 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!stern.fokus.gmd.de!ceres.fokus.gmd.de!zib-berlin.de!news.mathworks.com!udel!gatech!howland.reston.ans.net!ix.netcom.com!netcom.com!NewsWatcher!user From: hbaker@netcom.com (Henry Baker) Subject: Re: Does memory leak? Message-ID: Sender: hbaker@netcom9.netcom.com Organization: nil References: <3kopao$ekg@nef.ens.fr> Date: Fri, 24 Mar 1995 01:57:25 GMT Date: 1995-03-24T01:57:25+00:00 List-Id: In article <3kopao$ekg@nef.ens.fr>, sands@clipper.ens.fr (Duncan Sands) wrote: > Does Ada leak memory? I would like to believe it doesn't, but > how does it manage not to (without having to use unchecked > deallocation)? > > For example, if I have a pointer to a block of memory, and I set > that pointer to null, in simple cases I am ready to believe that > the compiler knows I'm finished with the block... but if the > pointer is to a complicated self-referential structure, some sort > of black magic seems needed to work out whether I'm really > finished with that structure or not. Can this truly be done > efficiently? > > You can see that I know nothing about how garbage collection works, > and precious little about what Ada requires for memory management. > I suspect I'm not the only one. If someone could demystify all this > for me, I would be very grateful... Most serious Ada compilers try pretty hard not to leak from internal leaks. However, objects that you allocate yourself with 'new' are considered your problem. Huge amounts of network, conference and newsletter bandwidth have been wasted on trying to get around the fact that Ada doesn't provide a built-in solution to this problem. (Of course the situation in Ada is magnified 1000-fold for C++, where detecting and recovering from memory leaks is a thriving industry.) [Why is it that people are willing to pay truly large bucks _after_ the fact for something that they could have gotten relatively cheaply up-front?] -- www/ftp directory: ftp://ftp.netcom.com/pub/hb/hbaker/home.html