Struct rustc_arena::DropArena [−][src]
pub struct DropArena {
destructors: RefCell<Vec<DropType>>,
arena: DroplessArena,
}Expand description
An arena which can be used to allocate any type.
Safety
Allocating in this arena is unsafe since the type system
doesn’t know which types it contains. In order to
allocate safely, you must store a PhantomData<T>
alongside this arena for each type T you allocate.
Fields
destructors: RefCell<Vec<DropType>>Expand description
A list of destructors to run when the arena drops.
Ordered so destructors gets dropped before the arena
since its destructor can reference memory in the arena.
arena: DroplessArenaImplementations
impl DropArena[src]
impl DropArena[src]pub unsafe fn alloc<T>(&self, object: T) -> &mut T where
T: Send, [src]
T: Send,
pub unsafe fn alloc_from_iter<T, I>(&self, iter: I) -> &mut [T] where
T: Send,
I: IntoIterator<Item = T>, [src]
T: Send,
I: IntoIterator<Item = T>,