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
sourceimpl Clone for lean_object
impl Clone for lean_object
sourcefn clone(&self) -> lean_object
fn clone(&self) -> lean_object
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for lean_object
impl Debug for lean_object
impl Copy for lean_object
Auto Trait Implementations
impl RefUnwindSafe for lean_object
impl Send for lean_object
impl Sync for lean_object
impl Unpin for lean_object
impl UnwindSafe for lean_object
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more