Struct comet::large_space::PreciseAllocation [−][src]
#[repr(C)]pub struct PreciseAllocation {
pub cell_size: usize,
pub mark: bool,
pub index_in_space: u32,
pub adjusted_alignment: bool,
pub has_valid_cell: bool,
pub is_newly_allocated: bool,
}Expand description
Precise allocation used for large objects (>= LARGE_CUTOFF). Starlight uses mimalloc that already knows what to do for large allocations. The GC shouldn’t have to think about such things. That’s where PreciseAllocation comes in. We will allocate large objects directly using mi_malloc, and put the PreciseAllocation header just before them. We can detect when a *mut GcPointerBase is a PreciseAllocation because it will have the ATOM_SIZE / 2 bit set.
Fields
cell_size: usizeallocation request size
mark: boolindex_in_space: u32index in precise_allocations
adjusted_alignment: boolIs alignment adjusted?
has_valid_cell: boolIs this even valid allocation?
is_newly_allocated: boolImplementations
Alignment of pointer returned by Self::cell.
Check if raw_ptr is precisely allocated.
Create PreciseAllocation from pointer
Return base pointer
Return cell address, it is always aligned to Self::HALF_ALIGNMENT.
Return true if raw_ptr is above lower bound
Return true if raw_ptr below upper bound
Returns header size + required alignment to make cell be aligned to 8.
Try to create precise allocation (no way that it will return null for now).