[Gc] Regarding Object map

Boehm, Hans hans.boehm at hp.com
Mon Mar 1 12:10:04 PST 2004


The hb_map referenced by each object header specifies for each byte offset
within the block if

- A pointer to that offset within the block is a valid object pointer, and

- If so, what value needs to be subtracted from the pointer to get to the
beginning of the object.  (This is complicated slightly by the fact that
each entry is constrained to a byte.)

The maps are shared between different blocks containing objects of the same size.
The global GC_obj_map is a table of those maps that have been built already,
so that they can be reused.

The same thing could often be done with a mod operation and some tests.  At the time at
which the code was written, this sort of table lookup was appreciably faster.  And
it buys a fair amount of flexibility: GC_register_displacement() can be implemented
with close to zero cost.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com]On Behalf Of vasantha selvi
> Sent: Monday, March 01, 2004 5:45 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] Regarding Object map
> 
> 
> Hi Hans,
>         With your direction I gone through the tree structure 
> used in Gc. I 
> am to get some idea about GC_top_index and GC_bottom_index 
> but really I am 
> not get much about the object map.
> I would like to get an understanding of how the object map is getting 
> created and then how it is getting used by the GC allocator.
> 
> Awaiting for your response,
> With Regards,
> VS
> 
> _________________________________________________________________
> Contact brides & grooms FREE! 
> http://www.shaadi.com/ptnr.php?ptnr=hmltag 
> Only on www.shaadi.com. Register now!
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list