Struct comet::header::HeapObjectHeader [−][src]
#[repr(C)]pub struct HeapObjectHeader { /* fields omitted */ }Expand description
HeapObjectHeader contains meta data per object and is prepended to each object.
+-----------------+------+------------------------------------------+
| name | bits | |
+-----------------+------+------------------------------------------+
| padding | 32 | Only present on 64-bit platform. |
+-----------------+------+------------------------------------------+
| GCInfoIndex | 14 | |
| unused | 1 | |
| unused | 1 | In construction encoded as |false|. |
+-----------------+------+------------------------------------------+
| size | 13 | 17 bits because allocations are aligned. |
| unused | 1 | |
| cell state | 2 | |
+-----------------+------+------------------------------------------+Notes:
- See GCInfoTable for constraints on GCInfoIndex.
sizefor regular objects is encoded with 14 bits but can actually represent sizes up to |kBlinkPageSize| (2^17) because allocations are always 8 byte aligned (see kAllocationGranularity).sizefor large objects is encoded as 0. The size of a large object is stored in PreciseAllocation::cell_size.
Implementations
Check if allocation is “precise”. Precise allocations are large allocations that have larger header stored behind HeapObjectHeader.
Creates heap object header from object pointer. It must be valid pointer.
Returns GCInfoIndex of allocated object.
Returns size of an object. If it is allocated in large object space 0 is returned.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for HeapObjectHeader
impl Send for HeapObjectHeader
impl Sync for HeapObjectHeader
impl Unpin for HeapObjectHeader
impl UnwindSafe for HeapObjectHeader
Blanket Implementations
Mutably borrows from an owned value. Read more