[][src]Struct memory_manager::object::ObjectDescriptor

pub struct ObjectDescriptor {
    pub unpacked_field_count: usize,
    pub pointer_count: usize,
}

Object descriptors.

Object Layout

┏━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━┓
┃ pointer to descriptor │ unpacked fields │ pointers ┃
┗━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━┛

All unpacked fields are gathered at the front of the object. Therefore, all the pointer fields are left at the back. This makes the object descriptor simple: 2 words determines the layout.

Fields

unpacked_field_count: usize

Number of unpacked fields in objects described by this descriptor.

pointer_count: usize

Number of boxed fields (i.e. pointers) in objects described by this descriptor.

Implementations

impl ObjectDescriptor[src]

pub fn total_size(&self) -> usize[src]

The total size occupied by this kind of object. Always aligned to a Word (i.e. usize).

Size is calculated as follows:

  • Descriptor Pointer: 1 word
  • Unpacked Fields: 1 word/each
  • Pointers: 1 word/each

Auto Trait Implementations

impl Send for ObjectDescriptor

impl Sync for ObjectDescriptor

impl Unpin for ObjectDescriptor

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.