[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comparing Pika-syle and JNI-style
> From: bear <bear@xxxxxxxxx>
> 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?
Simple liveness analysis will do the trick.
> 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. But I haven't heard of a scheme that has
> such a problem being released.
At least in the case of SCM and its children, that's because the
conservative part of the conservative GC takes tag bits into account
when deciding "is that (maybe) a pointer?". It would take really
outrageous optimizations to trip that up.
Hmm. Speaking of outrageous optimizations .... I wonder if variations
on the "xor-doubly-linked-list" trick could be used to save registers
if applied as a C optimization? :-)