Re: I need an unused bit in the bidirectionnal layout object
Chris Pickett <[email protected]> Thu, 03 Mar 2005 12:42:59 -0500
| Newsgroups | gmane.comp.java.vm.sablevm.devel |
|---|---|
| Message-ID | <[email protected]> |
Sébastien Adam wrote:
> Hi,
>
> I write a mark-compact gc for SableVM. In order to mark an object, I
> use a bit in the header. A problem occurs while a bidirectionnal
> layout object has no bit unused. Is there a possibility to change the
> use of some others bits to free a bit.
>
> If it is not possible, can I use a bit in the start_offset of the object.
My old comments in my sandbox (which really should get committed by me
before they go stale!) say that the object header where the thin lock
resides has a first word that looks like this:
bits 31 30-21 20-16 15-0
SHAPE THREAD_ID RECURSIVE_COUNT EXTRA_BITS
value ? ? ? ?
So if you look at system.c and system.h, you might be able to put your
info in the extra unused bits at the least significant end of the
lockword (this is the first word in the object). You should use
#define'd constants and write utility masking and unmasking functions as
is done for the locking algorithm in thread.c to make your design
choices somewhat modular.
If this info/advice is wrong/insufficient, I'm relying on Etienne or
Greg to correct me in the next few days, otherwise you can trust it.
Cheers,
Chris