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>>
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: DroplessArena
Implementations
pub unsafe fn alloc_from_iter<T, I>(&self, iter: I) -> &mut [T] where
T: Send,
I: IntoIterator<Item = T>,
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DropArena
impl UnwindSafe for DropArena
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes