Struct rustc_arena::DroplessArena [−][src]
pub struct DroplessArena {
start: Cell<*mut u8>,
end: Cell<*mut u8>,
chunks: RefCell<Vec<TypedArenaChunk<u8>>>,
}
Fields
start: Cell<*mut u8>
A pointer to the start of the free space.
end: Cell<*mut u8>
A pointer to the end of free space.
The allocation proceeds from the end of the chunk towards the start. When this pointer crosses the start pointer, a new chunk is allocated.
chunks: RefCell<Vec<TypedArenaChunk<u8>>>
A vector of arena chunks.
Implementations
Allocates a byte slice with specified layout from the current memory
chunk. Returns None
if there is no free space left to satisfy the
request.
Allocates a slice of objects that are copied into the DroplessArena
, returning a mutable
reference to it. Will panic if passed a zero-sized type.
Panics:
- Zero-sized types
- Zero-length slices
pub(crate) unsafe fn write_from_iter<T, I: Iterator<Item = T>>(
&self,
iter: I,
len: usize,
mem: *mut T
) -> &mut [T]
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for DroplessArena
impl !Sync for DroplessArena
impl Unpin for DroplessArena
impl UnwindSafe for DroplessArena
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: 48 bytes