pub struct TwoBufferBumpAllocator { /* private fields */ }Expand description
Two-buffer bump allocator system for safe multi-pass compilation
This system solves several problems with the original single-buffer approach:
- Enables intermediate memory cleanup between passes
- Prevents stack overflow through controlled recursion depth
- Provides safe lifetime management for buffer swapping
- Maintains performance benefits of bump allocation
Implementations§
Source§impl TwoBufferBumpAllocator
impl TwoBufferBumpAllocator
Sourcepub fn swap_and_clear(self) -> Self
pub fn swap_and_clear(self) -> Self
Swaps buffers and clears the now-unused buffer Returns a new instance with swapped buffers for safe lifetime management
Sourcepub fn with_max_recursion_depth(self, depth: usize) -> Self
pub fn with_max_recursion_depth(self, depth: usize) -> Self
Sets maximum recursion depth for stack overflow protection
Sourcepub fn max_recursion_depth(&self) -> usize
pub fn max_recursion_depth(&self) -> usize
Gets maximum recursion depth
Trait Implementations§
Source§impl Debug for TwoBufferBumpAllocator
impl Debug for TwoBufferBumpAllocator
Auto Trait Implementations§
impl Freeze for TwoBufferBumpAllocator
impl !RefUnwindSafe for TwoBufferBumpAllocator
impl !Send for TwoBufferBumpAllocator
impl !Sync for TwoBufferBumpAllocator
impl Unpin for TwoBufferBumpAllocator
impl UnsafeUnpin for TwoBufferBumpAllocator
impl !UnwindSafe for TwoBufferBumpAllocator
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