mmtk-core
mmtk-core copied to clipboard
Allocator support for extra header words
We need a general solution to allow extra header words for allocators. There are different scenarios we need this:
- We may globally add some extra header words for different purposes (debugging, profiling, etc). This is a build-time constant and is applied to all the allocators in a plan.
- Certain policies may reserve extra words. This is only applied to allocator instances. One example is mark compact, which uses the bump pointer allocator, but reserves one extra word for forwarding pointers. Other bump pointer allocators in the same plan will not reserve this extra word. We currently make a new allocator type
MarkCompactAllocator
, and for the new allocator, we allocate an extra word. But this is not ideal. Ideally we should still useBumpAllocator
for mark compact.
Ideally the extra header words is defined as a constant. However, it may not be possible/easy to do this. Possibly we can make them as variables, as long as they are JIT-time constants for the binding's JIT.