[Gc] Possible bug: GC_realloc

Bryan Ischo bji at tivo.com
Mon Feb 18 11:25:04 PST 2013


On 02/16/13 00:14, Bruce Hoult wrote:
> std::list does not use memory allocated by the GC so it will not be
> traced by the GC. Therefore anything which is pointed to only by the
> std::list will be regarded by the GC as being unreachable, and will
> therefore be collected, leaving an invalid pointer in the list.
>

Thank you for the response, I think I was confused by the fact that the 
std::list in question was on the stack and I had thought (erroneously) 
that any memory pointed to from there (even if it were allocated by 
malloc() and not libgc) would be traced by libgc.  But instead it must 
be the case that any memory not allocated by libgc and not on the stack 
or in the bss or any other static data segment is not traced through by 
libgc when looking for pointers.

Thank you again,
Bryan



More information about the Gc mailing list