[Gc] How does Boehm GC identify values as pointers?

Andy Wingo wingo at pobox.com
Mon Feb 18 01:06:15 PST 2013


On Fri 15 Feb 2013 12:25, Wolfgang Draxinger <Wolfgang.Draxinger at physik.uni-muenchen.de> writes:

> I'm wondering, how my handle values may clash with pointer
> identification.

One way to be sure that they don't clash is to give your handles some
low-order tag bits.  By default the BDW GC only marks pointers to the
start of an object, and all object allocations are 8-byte aligned, so
any value with a 1 in any of the 3 low bits will not be treated as a
pointer.

Andy
-- 
http://wingolog.org/


More information about the Gc mailing list