rune::core::gc::heap

Struct GcHeap

Source
#[repr(C)]
pub(crate) struct GcHeap<T: ?Sized> { header: UnsafeCell<GcHeader>, data: T, }
Expand description

A block of memory allocated on the heap that is managed by the garbage collector.

Fields§

§header: UnsafeCell<GcHeader>§data: T

Implementations§

Source§

impl GcHeap<SymbolCellInner>

Source

const NULL: *mut u8 = {0x0 as *mut u8}

Source

const EMTPTY: AtomicPtr<u8> = _

Source

fn new_normal(name: &'static str, block: &Block<true>) -> Self

Source

pub(in core) const fn new_static( name: &'static str, ) -> Self

Source

pub(in core) const fn new_static_special( name: &'static str, ) -> Self

Source

fn new_const(name: &'static str, _block: &Block<true>) -> Self

Source

pub(in core) const fn new_static_const( name: &'static str, ) -> Self

Source

fn new_uninterned<const C: bool>(name: &str, bk: &Block<C>) -> Self

Source§

impl<T> GcHeap<T>

Source

pub(in core) const fn new( data: T, constant: bool, ) -> Self

Source

pub(in core) const fn new_pure( data: T, ) -> Self

Allocate a new object that is not managed by the garbage collector. This is used for “pure” storage of objects that are allocated at the start of the program and never freed. Only used for the Symbol map at the moment.

Source

fn header(&self) -> &GcHeader

Source

pub(in core) fn forward( &self, fwd_ptr: NonNull<u8>, )

Source

pub(in core) fn allocation_state( &self, ) -> AllocState

Source

fn is_marked(&self) -> bool

Trait Implementations§

Source§

impl IntoObject for GcHeap<SymbolCellInner>

Source§

type Out<'ob> = Symbol<'ob>

Source§

fn into_obj<const C: bool>(self, block: &Block<C>) -> Gc<Self::Out<'_>>

Source§

impl<T> Markable for GcHeap<T>

Source§

type Value = NonNull<GcHeap<T>>

Source§

fn move_value(&self, to_space: &Bump) -> Option<(Self::Value, bool)>

Source§

impl<T: PartialEq> PartialEq<T> for GcHeap<T>

Source§

fn eq(&self, other: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for GcHeap<SymbolCellInner>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialEq> PartialEq for GcHeap<T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Trace> Trace for GcHeap<T>

Source§

fn trace(&self, state: &mut GcState)

Source§

impl<T: Debug + ?Sized> Debug for GcHeap<T>

Source§

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

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

impl<T: Display> Display for GcHeap<T>

Source§

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

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

impl<T> Deref for GcHeap<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T> DerefMut for GcHeap<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: Eq> Eq for GcHeap<T>

Source§

impl<T: Sync> Sync for GcHeap<T>

Auto Trait Implementations§

§

impl<T> !Freeze for GcHeap<T>

§

impl<T> !RefUnwindSafe for GcHeap<T>

§

impl<T> Send for GcHeap<T>
where T: Send + ?Sized,

§

impl<T> Unpin for GcHeap<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for GcHeap<T>
where T: UnwindSafe + ?Sized,

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.