Struct lean_sys::lean_object

source ·
#[repr(C)]
pub struct lean_object { pub m_rc: c_int, pub m_cs_sz: u16, pub m_other: u8, pub m_tag: u8, }
Expand description

Lean object header.

The reference counter m_rc field also encodes whether the object is single threaded (> 0), multi threaded (< 0), or reference counting is not needed (== 0). We don’t use reference counting for objects stored in compact regions, or marked as persistent.

For “small” objects stored in compact regions, the field m_cs_sz contains the object size. For “small” objects not stored in compact regions, we use the page information to retrieve its size.

During deallocation and 64-bit machines, the fields m_rc and m_cs_sz store the next object in the deletion TODO list. These two fields together have 48-bits, and this is enough for modern computers. In 32-bit machines, the field m_rc is sufficient.

The field m_other is used to store the number of fields in a constructor object and the element size in a scalar array.

Fields§

§m_rc: c_int§m_cs_sz: u16§m_other: u8§m_tag: u8

Trait Implementations§

source§

impl Clone for lean_object

source§

fn clone(&self) -> lean_object

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for lean_object

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for lean_object

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.