Struct jlrs::memory::frame::GcFrame [−][src]
pub struct GcFrame<'frame, M: Mode> { /* fields omitted */ }
A frame that can be used to root values.
Roots are stored in slots, each slot can contain one root. Frames created with slots will preallocate that number of slots. Frames created without slots will dynamically create new slots as needed. If a frame is created without slots it is able to create at least 16 slots.
If there is sufficient capacity available, a new frame will use this remaining capacity. If the capacity is insufficient, more stack space is allocated.
Implementations
impl<'frame, M: Mode> GcFrame<'frame, M>
[src]
impl<'frame, M: Mode> GcFrame<'frame, M>
[src]pub fn n_roots(&self) -> usize
[src]
Returns the number of values currently rooted in this frame.
pub fn n_slots(&self) -> usize
[src]
Returns the number of slots that are currently allocated to this frame.
pub fn capacity(&self) -> usize
[src]
Returns the maximum number of slots this frame can use.
#[must_use]pub fn alloc_slots(&mut self, additional: usize) -> bool
[src]
Try to allocate additional
slots in the current frame. Returns true
on success, or
false
if self.n_slots() + additional > self.capacity()
.
Trait Implementations
Auto Trait Implementations
impl<'frame, M> RefUnwindSafe for GcFrame<'frame, M> where
M: RefUnwindSafe,
impl<'frame, M> RefUnwindSafe for GcFrame<'frame, M> where
M: RefUnwindSafe,
impl<'frame, M> !UnwindSafe for GcFrame<'frame, M>
impl<'frame, M> !UnwindSafe for GcFrame<'frame, M>
Blanket Implementations
impl<'frame, T> Gc for T where
T: Frame<'frame>,
[src]
impl<'frame, T> Gc for T where
T: Frame<'frame>,
[src]