Hello! Neil Jerram <n...@ossau.uklinux.net> writes:
> Just checking this because Ludovic said recently that (SCM_BOOL_F == > 0) would have nice properties for BDW-GC. Actually he wasn't quite right when he said that. :-) The issue with BDW-GC is that "disappearing links" (weak pointers in libgc parlance) replace pointers to objects that have been reclaimed by NULL, and there's no way to tell it to use some other value. That leads to insanities in the weak hash table implementation [0, 1], which I thought could somehow vanish if SCM_BOOL_F == 0. Unfortunately that's not true; it would even make things worse because NULL would now be a valid Scheme value. Instead what's really needed is a special pointer-to-reclaimed-object value that can be distinguished from valid Scheme values since that value ends up in the car or cdr of weak pairs in hash table buckets. As such, SCM_PACK (NULL) was a good choice until now. SCM_UNDEFINED == 0 would work fine because SCM_UNDEFINED is not a valid Scheme value, but it wouldn't change the implementation. Thoughts? Thanks, Ludo'. [0] http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/weaks.c?h=boehm-demers-weiser-gc#n40 [1] http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/hashtab.c?h=boehm-demers-weiser-gc#n97