[Gc] Changing ‘GC_should_collect’ to account for malloc’d memory

Ludovic Courtès ludo at gnu.org
Sun Feb 27 02:49:33 PST 2011


Hi,

Bruce Hoult <bruce at hoult.org> writes:

> I don't think the GC should consider all malloc'd memory, but only
> memory which might be freed as a result of a collection.
>
> It might make sense to have an API that allows objects that register a
> finalizer to say how much non-GC memory will be freed when the
> finalizer is run.

Yes, but in the example above, you can’t tell: there are GC’d objects
associated with several KiB of ‘iconv_t’ objects, but you can’t tell
exactly how much because it’s glibc that allocates it.

Thanks,
Ludo’.



More information about the Gc mailing list