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,a77baf86c187076a X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Garbage collection (was a spinoff of a spinoff of a GA diatribe) Date: 1996/10/27 Message-ID: #1/1 X-Deja-AN: 192495144 references: <9610211427.AA06636@most> organization: New York University newsgroups: comp.lang.ada Date: 1996-10-27T00:00:00+00:00 List-Id: Someone (I lost track) gave as an advantage of garbage collection: > > Pro: ... > > Faster - allocations can be _much_ faster and collections can be > > much more efficient than good ol' "free". I agree on the allocation, but the free claim is dubious, it depends on a lot of factors. A true GC, as opposed to a conservative GC, can be made to run in time proportional to the amount of non-garbage (see for example the description of the SPITBOL collector in SP&E 1977 article by Dewar and McCann), so if you have a LOT of garbage this can be true. But if you are doing lots of GC's then you can end up spending a lot of time freeing a little stuff (ttrue of conservative GC as well of course). On the other hand, it is quite possible to make free quite efficient. I wrote the collector for the x86 Alsys compiler (I don't know if the TSP ObjectAda still uses it or not), and it had the property that free was a single instruction that was generated in line.