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,3498dd887729ed19 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Garbage Collection in Ada Date: 1996/10/17 Message-ID: #1/1 X-Deja-AN: 190310576 references: <01bbb910$f1e73f60$829d6482@joy.ericsson.se><199610132138291604607@dialup101-6-14.swipnet.se><1996Oct13.194807.1@eisner> organization: New York University newsgroups: comp.lang.ada Date: 1996-10-17T00:00:00+00:00 List-Id: John Howard said "This model would not be as useful to implement non-conservative GC's because they are highly compiler specific and most likely transparent if enabled. Programs written for a non-conservative GC are brittle. They leak memory if you disable GC and they cause trouble for porting to another compiler." How odd, this seems exactly the wrong way round, assuming you mean by brittle, breaking easily, I would make exactly the opposite judgment. A program that uses a conservative GC either counts on storage being freed or it does not. If it does not, then it really need not bother with GC at all. if it does, then there is always a possibility, perhaps small, that it will not get what it counts on. Are there really programs that count on conservative GC working? Well perhaps so. For example, Microsoft Word, at least the version I use, sometimes leaks memory, and just possibly this is a data dependent effect if it uses conservative GC, since it could be that if certain words are in your document, you are unlucky and some storage does not get freed. Similarly you can imagine a command interpretor which works most of the time, except when a certain person logs on, because their password causes a critical section of storage not to be freed. I suppose if you are in an environment, e.g. virtual memory spilled to disk, where not freeing storage is only a performance issue, then CGC makes sense. But otherwise I can't see relying on the technique Proper GC seems quite the opposite. Well yes, of course if you turn it off, the program breaks, what a pointless point! That's like saying, I find floating-point arithmetic unreliable, if I disable my floating-point on the processor, the program fails. Or, I find tasking unreliable, because if I tell the OS to disable tasking the program fails. As to porting to a non-GC version of the compiler, this of course arises only for languages where GC is not universal, and is a consideration of portability, but in practice most programs place restrictions on implementations that are not universally supported. Hands up those who use 32 bit integers in your programs! Is that brittle simply because some Ada compilers don't have 32 bit integers? I don't think so!