Re: Comparing Pika-syle and JNI-style
Per Bothner 15 Jan 2004 01:26 UTC
bear wrote:
> You were referring, then, to correctness issues, where the C compiler
> makes some optimization (probably an optimization involving pointer
> arithmetic or pointer bit-operations) and as a result the conservative
> collector erroneously frees live data that the program is using it to
> refer to?
Yes.
> I'd think that schemes might be particularly vulnerable to this since
> a lot of implementations use "flag bits" in their pointers to identify
> representations, types, etc.
This qualifies as "mangling" pointers. Obviously you'd better not
used mangled pointers in conjunction with a GC that doesn't
know about pointer mangling. You could modify a GC to handle mangled
pointers, but a conservative GC is unlikely to work well. It might
if it's just 2-3 low-order bits that are used for typecodes.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/