Re: 'conservative' GC == 'risky' GC (Thomas M. Breuel)
Wed, 25 May 1994 20:59:38 GMT

          From comp.compilers

Related articles
'conservative' GC == 'risky' GC (1994-05-21)
Re: 'conservative' GC == 'risky' GC (1994-05-22)
Re: 'conservative' GC == 'risky' GC (1994-05-23)
Re: 'conservative' GC == 'risky' GC (1994-05-24)
Re: 'conservative' GC == 'risky' GC (1994-05-25)
Re: 'conservative' GC == 'risky' GC (1994-05-26)
Re: 'conservative' GC == 'risky' GC (1994-05-27)
Re: 'conservative' GC == 'risky' GC (1994-05-27)
Re: 'conservative' GC == 'risky' GC chase@Think.COM (1994-05-26)
Re: 'conservative' GC == 'risky' GC (1994-05-31)
Re: 'conservative' GC == 'risky' GC (1994-05-30)
[3 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Thomas M. Breuel)
Keywords: GC, comment
Organization: IDIAP
References: 94-05-084 94-05-097
Date: Wed, 25 May 1994 20:59:38 GMT (David Keppel) writes:
|> It's also worth noting that even with GC-safe code generation practices it
|> is still trivial to produce unsafe C programs -- the application can
|> obscure a pointer e.g. by XORing it, or can store it temporarily on disk
|> (outside of the default root set) and so on (but writing ANSI C is a good
|> start). The implication here is that only a subset of all C programs are
|> GC-safe and, in particular, you should be careful both about your code and
|> the code you link with.

ANSI C programs that do not use implementation dependent features can be
compiled to be safe in the presence of a conservative garbage collector.
In fact, even programs using the implementation dependent
pointer<->integer conversions of ANSI C could be compiled to be safe in
the presence of conservative GC. Basically, all the runtime would have to
do is to record those pointers that have been converted in this way and
exempt them from collection (but you need to deallocate them explicitly
after any such operation).

Of course, it would be preferable if facilities for garbage collection and
its interaction with language features like casts were actually defined in
the C/C++ language standards. The existence of conservative GC "add-ons"
to a wide variety of compilers demonstrates that this does not impose a
significant burden on language implementors.

[Isn't a strictly conforming program allowed to write a pointer to a file
and later read it back in? -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.