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.
  • size for 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).
  • size for 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.

Set this header as free.

Creates heap object header from object pointer. It must be valid pointer.

Returns payload of this heap object header.

Returns GCInfoIndex of allocated object.

Returns size of an object. If it is allocated in large object space 0 is returned.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.