-
Notifications
You must be signed in to change notification settings - Fork 76
implement a feature to allocate an extra word ahead of each individua… #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,9 +285,12 @@ impl Block { | |
let mut cell = self.start(); | ||
let mut last = unsafe { Address::zero() }; | ||
while cell + cell_size <= self.start() + Block::BYTES { | ||
#[cfg(not(feature = "extra_header"))] | ||
// The invariants we checked earlier ensures that we can use cell and object reference interchangably | ||
// We may not really have an object in this cell, but if we do, this object reference is correct. | ||
let potential_object = ObjectReference::from_raw_address(cell); | ||
#[cfg(feature = "extra_header")] | ||
let potential_object = ObjectReference::from_raw_address(cell + VM::EXTRA_HEADER_BYTES); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The binding can config |
||
|
||
if !VM::VMObjectModel::LOCAL_MARK_BIT_SPEC | ||
.is_marked::<VM>(potential_object, Ordering::SeqCst) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to clarify that
VM::EXTRA_HEADER_BYTES
will control the exact size of extra header, and there is no control on the alignment of the extra header. We just guarantee there areEXTRA_HEADER_BYTES
before the address we return. It could be unaligned access if the binding attempts to write pointers to the extra bytes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this feature only intended for debugging, or can be used in a performance setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is only intended for debugging.