[Gc] Basic questions
Sat, 10 May 2003 15:12:14 +1000
On 09-May-2003, Emmanuel Stapf [ES] <firstname.lastname@example.org> wrote:
> > 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.
That is supposed to work.
> 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 GC with the ALL_INTERIOR_POINTERS?
Yes, it should be.
You don't need to do GC_register_displacement(0).
(Maybe that is why it was crashing?)
Fergus Henderson <email@example.com> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.