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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aa2e415128e40fff X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Question about garbage collection Date: 1998/04/19 Message-ID: #1/1 X-Deja-AN: 345809935 References: <6h851g$sq$1@news.tm.net.my> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 893039104 2922 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-04-19T00:00:00+00:00 List-Id: Ed says <> I assume this is a conservative garbage collector. This is not the same as true GC, but is often quite effective. I would guess most Ada compilers would be compatible with a number of packages of this type. Basically any compiler that uses malloc and free in a conventional manner wlil be compatible (the use of certain techniques like virtual origins can mess things up). People have used a number of different conservative collectors with GNAT successfully. THe conservative collectors work by not compacting memory, and by holding onto memory if any pointer *might* (rather than does) reference a block (e.g. if an integer value just happens to match the address of a block, then the block may be preserved. True garbage collection has to be effectively integrated into the compiler, since it must know the data types of everything. This is quite tricky in the presence of variant records and class wide types. It would be a nice project to try to add true GC to GNAT, but no one has tried this yet that I am aware of. It is not impossi ble to do (the GCC Modula 3 compiler has true GC).