-
Notifications
You must be signed in to change notification settings - Fork 69
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
Expose alloc_slow. Add a section in user guide about allocation optimization #967
Conversation
the tests in the doc
This looks good to me. I wonder if |
// Do slow path allocation with MMTk | ||
let addr = default_allocator.alloc_slow(size, 8, 0); | ||
// Copy bump pointer values to the fastpath BumpPointer | ||
storage.default_bump_pointer = default_allocator.bump_pointer; |
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.
Note: If the default_bump_pointer
is initialized with (0, 0), it will be updated with meaningful values here in the first allocation.
That's right. VMs may store the cursor and limit in its own style, and may not have the same layout as our |
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.
LGTM
This PR exposes
alloc_slow()
to the bindings, adds a few public methods to allow bindings to implement allocation efficiently without duplicating mmtk-core code, and adds a section in the user guide to discuss allocation optimization.The changes in this PR includes:
alloc_slow()
inmemory_manager
.Mutator::allocator()
to allow bindings to get a specific allocator from an allocator selector. AddMutator::allocator_impl()
to allow bindings to get a typed allocator from a selector.Mutator::get_allocator_base_offset()
to allow bindings to use a specific allocator without selector (for performance).SUMMARY.md
in the user guide.Address::as_mut_ref()
.Related discussion on Zulip: https://mmtk.zulipchat.com/#narrow/stream/262679-General/topic/Refilling.20BumpPointer.20using.20AllocatorInfo/near/394142997