pub struct StackPool { /* private fields */ }Expand description
A bounded cache of guard-page-backed stacks.
Every mapping the pool allocates is stamped with a pool-local identity that survives cache reuse and is retired once the mapping leaves the pool for good.
Implementations§
Source§impl StackPool
impl StackPool
Sourcepub fn acquire(&mut self) -> Result<MappedStack>
pub fn acquire(&mut self) -> Result<MappedStack>
Acquires a cached stack or allocates a new one.
Sourcepub fn release(&mut self, stack: MappedStack)
pub fn release(&mut self, stack: MappedStack)
Returns a completed stack to the bounded cache.
Sourcepub fn snapshot(&self) -> StackPoolSnapshot
pub fn snapshot(&self) -> StackPoolSnapshot
Returns the current counters.
Auto Trait Implementations§
impl Forget for StackPool
impl Freeze for StackPool
impl RefUnwindSafe for StackPool
impl Send for StackPool
impl Sync for StackPool
impl Unpin for StackPool
impl UnsafeUnpin for StackPool
impl UnwindSafe for StackPool
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
Mutably borrows from an owned value. Read more