public final class MarkSweepLocal extends SegregatedFreeListLocal<MarkSweepSpace>
A free list block is a contiguous region of memory containing cells of a single size class, and is a construct of the SegregatedFreeList. This class extends the block to include a mark bitmap. During the mark phase, if an object is encountered with the mark bit in its header unset, it is set and the mark bit in the block header corresponding to that object is set. The rationale behind this approach is that testing (and setting) the mark bit in the object header is cheap, while using a bitmap makes sweeping more efficient. This approach maximizes the speed of the common case when marking, while also allowing for fast sweeping, with minimal space overhead (2 bits per object).
SegregatedFreeList
,
MarkSweepSpace
currentBlock
freeList, space
Constructor and Description |
---|
MarkSweepLocal(MarkSweepSpace space)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
prepare()
Prepare for a collection.
|
void |
release()
Finish up after a collection.
|
allocSlowOnce, flush
alloc, getSpace
alignAllocation, alignAllocation, alignAllocationNoFill, allocSlow, allocSlowInline, determineCollectionAttempts, fillAlignmentGap, getMaximumAlignedSize, getMaximumAlignedSize
public MarkSweepLocal(MarkSweepSpace space)
space
- The mark-sweep space to which this allocator
instances is bound.