[gclist] gclist-digest V1 #40

boehm.PARC@xerox.com boehm.PARC@xerox.com
Thu, 18 Apr 1996 12:51:11 PDT


Darius Blasband wrote:

"Somehow, a conservatice GC such Boehm's have only a very tiny relationship
with the supporting language. It is not closely related to C at all. I
guess it could be usable almost as is with Fortran... One might say
that it is more system-oriented GC than a language-oriented GC."

I agree.  One of the initial uses of our collector was with assembly code
generated by student compilers.

However it would be nice to have the C standard explicitly define a subset that
is safe for use with conservative GC, and recognize conservative GC as a
possible extension.  The notion of a "strictly conforming" program in the 1989
standard is very nearly sufficient to guarantee that it can be safely collected
with a conservative garbage collector.  The few additions one would need are
mainly clarifications of ambiguities in the original standard.  (Some of these
may have since been officially clarified in other ways.  I haven't kept up on
the official interpretations.)

There are two reaons it would be helpful to have it mentioned in the standard,
even if it's an optional part of the standard:

1) It would encourage C compiler vendors to pay a bit of attention to GC-safety
issues, i.e. to keep undiguised pointers around.  It might even convince
computer architects to make that easier for the compiler vendors.  (I've
finally run into a case of unsafe code that wasn't written for that purpose.
Freddy Isaac determined that my grbage collector test program fails on an ARM
when compiled with the vendor compiler.  This is due to a GC-safety problem,
not an outright bug.  Admittedly the offending section of the test program
isn't very realistic.  The problem is caused by a very small limit on (signed)
displacements in load instructions and aggressive register reuse.)

2) A large number of people will not use this sort of facility unless it's
somehow endorsed by a standard.  (See the thread in comp.lang.c++.)

Hans