[Gc] Re: [PATCH] Allow registration of disappearing links on non-heapobjects

Ludovic Courtès ludo at gnu.org
Sat Jan 31 13:34:53 PST 2009


Ivan Maidanski <ivmai at mail.ru> writes:

> This is not a bug, it's the known behavior - see the comment for
> GC_general_register_disappearing_link() in gc.h: "Obj MUST be a
> pointer to the first word of an object we ALLOCATED".  I fact, I ran
> into this problem too

Oops, had missed this one.

> - see
> https://www.hpl.hp.com/hosted/linux/mail-archives/gc/2008-October/002400.html.
> This had 2 consequences: - for GC: addition of GC_ASSERT clause to
> GC_general_register_disappearing_link(); - for me: I added
> GC_base(obj) != NULL check before calling
> GC_general_register_disappearing_link() where obj could be a non-heap
> one.

In my case, I added a test that checks whether the pointer is in between
GC_{least,greatest}_plausible_heap_addr.  Presumably, this is more
efficient than calling `GC_base ()'?

Thanks for your quick answer!


More information about the Gc mailing list