[Gc] Basic questions

Emmanuel Stapf [ES] manus@eiffel.com
Fri, 9 May 2003 22:03:29 -0700

> I don't think so.  If you register offsets "2" and "4" using 
> GC_register_displacement(), and "p" is a pointer returned 
> from GC_malloc(), then "p", "(char *)p + 2", and "(char *)p + 
> 4" would all be considered valid pointers, but "(char *)p + 
> 1" and "(char *)p + 3" would not.  If you want to register 
> all offsets up to and including "n", then have to do so 
> explicitly, e.g. using a loop:

Thanks. In my case I just wanted to have (char *) p + 8. I tried that by using
`GC_register_displacement (8)', but it didn't work at all. My program is crashing
quickly after a few allocations.

Actually it brings up a question, if I do `GC_register_displacement(0)' and
`GC_register_displacement(8)' only, will it be more efficient than compiling the