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: usize

allocation request size

mark: boolindex_in_space: u32

index in precise_allocations

adjusted_alignment: bool

Is alignment adjusted?

has_valid_cell: bool

Is this even valid allocation?

is_newly_allocated: bool

Implementations

Alignment of allocation.

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.

Does this allocation contains raw_ptr?

Finalize cell if this allocation is not marked.

Try to create precise allocation (no way that it will return null for now).

return cell size

Destroy this allocation

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.