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,29850945228df59 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-23 14:20:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Boehm-Demers-Weiser conservative garbage collector and GNAT Date: 23 Jun 2003 17:11:18 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <1316747.mXveBPtf0Z@linux1.krischik.com> <874r2js14x.fsf@deneb.enyo.de> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1056402703 21678 128.183.235.92 (23 Jun 2003 21:11:43 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 23 Jun 2003 21:11:43 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:39621 Date: 2003-06-23T21:11:43+00:00 List-Id: Florian Weimer writes: > Stephen Leake writes: > > > I wrote a container library that does all the memory management I > > need. > > How do you prevent client code from keeping references to objects in > the container at the point of its finalization? My library does allow this. It is not a bullet-proof, "assume the client is an idiot" library. See the discussion on Grace lists for some reasons why. however, I normally code my apps so the container is always active; it's created when the app starts, and is one of the last things finalized when the app is shutting down. > Is erroneous execution a possibility? Yes, in the sense that Ada + my library allows it. > I don't think memory leaks are the most severe problem, dangling > references are. Yes. However, note that I said "all the memory management I need", not "all the memory protection a novice needs". Some small amount of discipline is expected on the part of the client; the goal is to get a good balance between container efficiency and protection against bugs. Now someone will say "C struck a better balance"; more power to them :). The issue of whether garbage collection is a good thing for novice programmers is an interesting one. My initial take would still be "no - don't let them get used to the crutch". But I'm willing to be convinced. -- -- Stephe