[Gc] mark bits for uncollectable

Bruce Hoult bruce at hoult.org
Wed Oct 25 22:53:03 PDT 2006

On 10/26/06, Hans Boehm <Hans.Boehm at hp.com> wrote:
> Having looked at it only superficially, I suspect it's fine with
> respect to correctness.  The problem is that now every malloc and free
> operation has to find and update the mark bit, right?

Yes, this is true.  It puts a relatively expensive (especially with
top index hash tables turned on) HDR operation into even the fast
allocation path, and this might matter for some people who are just
looking for a faster malloc/free.

So how else can you find out how many objects in a heap block of
uncollectable objects are free and how many in use?  Assume it's all
in use, and walk the appropriate free list, subtracting one for every
item that is in the block of interest?  Inefficient, if you then
iterate over all blocks, but I guess OK for GC_dump() purposes.

Hmm, I guess this would be useful as a cross-check of the mark bits
for blocks of collectable objects as well.

More information about the Gc mailing list