[Gc] Large block uncollected ?

Henning Makholm Henning at octoshape.com
Tue Aug 12 06:14:54 PDT 2008


> > In this case you should try
> > GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE instead.
>
> Reading more about the subject in README, it seems that I can
> also set :
>
> GC_all_interior_pointers = 0;

No - pointers found in stack and registers can always be interior,
unless the object is expicitly allocated IGNORE_OFF_PAGE.

This is becase pointers in stack/registers may be compiler
temporaries that have been offset into the object without the
programmer being aware. If the last access to a collectible
object refers to an interior file, the compiler may well choose
to add its offset to the last pointer to it some time before
the actual access. Such an offset pointer needs to keep the memory
alive, unless the programmer has explicitly promised to keep an
explicit non-offset pointer around, by using IGNORE_OFF_PAGE.

GC_all_interior_pointers controls the interpretation of pointers
from the _heap_. Because the content of heap objects is under
explicit programmer control, it makes sense for the programmer
to promise that there will be no interior pointers that need
to keep heap objects alive.

--
Henning Makholm
OctoShape ApS



More information about the Gc mailing list