Struct arena::TypedArena [−][src]
pub struct TypedArena<T> { ptr: Cell<*mut T>, end: Cell<*mut T>, chunks: RefCell<Vec<TypedArenaChunk<T>>>, _own: PhantomData<T>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
An arena that can hold objects of only one type.
Fields
ptr: Cell<*mut T>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A pointer to the next object to be allocated.
end: Cell<*mut T>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A pointer to the end of the allocated area. When this pointer is reached, a new chunk is allocated.
chunks: RefCell<Vec<TypedArenaChunk<T>>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A vector of arena chunks.
_own: PhantomData<T>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Marker indicating that dropping the arena causes its owned
instances of T
to be dropped.
Methods
impl<T> TypedArena<T>
[src]
impl<T> TypedArena<T>
pub fn new() -> TypedArena<T>
[src]
pub fn new() -> TypedArena<T>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Creates a new TypedArena
.
pub fn alloc(&self, object: T) -> &mut T
[src]
pub fn alloc(&self, object: T) -> &mut T
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Allocates an object in the TypedArena
, returning a reference to it.
pub fn alloc_slice(&self, slice: &[T]) -> &mut [T] where
T: Copy,
[src]
pub fn alloc_slice(&self, slice: &[T]) -> &mut [T] where
T: Copy,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Allocates a slice of objects that are copied into the TypedArena
, returning a mutable
reference to it. Will panic if passed a zero-sized types.
Panics:
- Zero-sized types
- Zero-length slices
fn grow(&self, n: usize)
[src]
fn grow(&self, n: usize)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Grows the arena.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Clears the arena. Deallocates all but the longest chunk which may be reused.
fn clear_last_chunk(&self, last_chunk: &mut TypedArenaChunk<T>)
[src]
fn clear_last_chunk(&self, last_chunk: &mut TypedArenaChunk<T>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<T> Drop for TypedArena<T>
[src]
impl<T> Drop for TypedArena<T>
impl<T: Send> Send for TypedArena<T>
[src]
impl<T: Send> Send for TypedArena<T>
Auto Trait Implementations
impl<T> !Sync for TypedArena<T>
impl<T> !Sync for TypedArena<T>