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-17 03:18:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta.corp.emc.com Newsgroups: comp.lang.ada Subject: Re: Boehm-Demers-Weiser conservative garbage collector and GNAT References: <1316747.mXveBPtf0Z@linux1.krischik.com> From: Ludovic Brenta Date: 17 Jun 2003 12:19:32 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 213.190.149.159 X-Trace: 1055845096 reader0.news.skynet.be 284 fa058819/213.190.149.159:57614 X-Complaints-To: abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:39317 Date: 2003-06-17T12:19:32+02:00 List-Id: Preben Randhol writes: > Ludovic Brenta wrote: > > - Write a thick Ada binding to the C garbage collector, with the same > > end result as above, but requiring an additional library at link > > time. > > Does this make sense? To rely on C to do the garbage collection of Ada ? Well, the garbage collector itself is language-independent, so it would work even on Ada objects. Indeed, it is already being used for the Java and Objective C runtimes of GCC. It supports finalisation of objects at collection time, so it could even work for Ada's controlled types. There would be benefits to this approach: less work (no reimplementation); and benefit from future updates to the GC. The downside, of course, is the increased complexity of the build configuration for client programs, and the necessity to keep the thick binding in sync with the GC library. The latter depends on how stable the public interface to the library is. Note that the third approach I mentioned (use the GC that is in GCC from within libgnat and libgnarl) differs only slightly, and has other benefits and drawbacks. For example: + the Ada runtime could also use the GC for itself, in addition to providing it to clients. + Keeping the GC and the Ada runtime in sync would be facilitated by the fact that both are in the GCC source tree; besides, the Boehm GC in GCC probably changes slowly since so much code already depends on it. + configuration management simplified to the extreme: to clients, the GC would just be part of the runtime provided by the compiler. - Only available to people using GCC 3.3 as their compiler, as opposed to GNAT 3.15p. I'm still curious to know what Martin's preferred approach is. -- Ludovic Brenta.