pub struct DataStack { /* private fields */ }Expand description
Per-thread data stack for bump-allocating frame-local data.
Implementations§
Source§impl DataStack
impl DataStack
Sourcepub fn has_space(&self, size: usize) -> bool
pub fn has_space(&self, size: usize) -> bool
Check if the current chunk has at least size bytes available.
Sourcepub fn push(&mut self, size: usize) -> *mut u8
pub fn push(&mut self, size: usize) -> *mut u8
Allocate size bytes from the data stack.
Returns a pointer to the allocated region (aligned to ALIGN).
The caller must call pop() with the returned pointer when done
(LIFO order).
Sourcepub fn push_frame(&mut self, size: usize) -> (*mut u8, bool)
pub fn push_frame(&mut self, size: usize) -> (*mut u8, bool)
Allocate a full interpreter frame and report whether it exactly reuses a just-cleared frame block.
Sourcepub unsafe fn pop(&mut self, base: *mut u8)
pub unsafe fn pop(&mut self, base: *mut u8)
Pop a previous allocation. base must be the pointer returned by
push(). Calls must be in LIFO order.
§Safety
base must be a valid pointer returned by push() on this data stack,
and all allocations made after it must already have been popped.
Sourcepub unsafe fn pop_frame(&mut self, base: *mut u8, size: usize)
pub unsafe fn pop_frame(&mut self, base: *mut u8, size: usize)
Pop a full frame whose localsplus slots have already been cleared.
§Safety
base and size must describe the most recent allocation returned by
push_frame, every later allocation must already be popped, and all
localsplus slots in the frame must have been cleared.
Trait Implementations§
Auto Trait Implementations§
impl !Sync for DataStack
impl Freeze for DataStack
impl RefUnwindSafe for DataStack
impl Unpin for DataStack
impl UnsafeUnpin for DataStack
impl UnwindSafe for DataStack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more