[Gc] Basic questions
Emmanuel Stapf [ES]
Fri, 9 May 2003 23:35:41 -0700
> You don't need to do GC_register_displacement(0).
> (Maybe that is why it was crashing?)
Actually I was not doing it, but I noticed that the windows implementation does a
call to `GC_register_displacement_inner(0)' in its initialization process.
Anyway, I've debugged it a little bit further, and the GC is overriding some of my
allocated memory which is why my program is crashing. The override occurs in
`DO_OBJ(0)' from `GC_reclaim_uninit2'. This happen on a block which I have
allocated with a size of 8 bytes which is the value of my displacement and of
course the call to GC_is_valid_displacement failed on this particular block.
Is there a reason why my pointer cannot be at the end of my allocated area? It
forces me to allocate a few extra bytes for nothing.
While I'm at it, I'm not sure to understand when I should be using `GC_malloc' vs
`GC_malloc_ignore_off_page' in my case where I have `GC_register_displacement(8)'