[][src]Struct rustc_arena::DroplessArena

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

impl DroplessArena[src]

pub(crate) fn grow(&self, additional: usize)[src]

pub(crate) fn alloc_raw_without_grow(&self, layout: Layout) -> Option<*mut u8>[src]

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.

pub fn alloc_raw(&self, layout: Layout) -> *mut u8[src]

pub fn alloc<T>(&self, object: T) -> &mut T[src]

pub fn alloc_slice<T>(&self, slice: &[T]) -> &mut [T] where
    T: Copy
[src]

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,
    mut iter: I,
    len: usize,
    mem: *mut T
) -> &mut [T]
[src]

pub fn alloc_from_iter<T, I: IntoIterator<Item = T>>(&self, iter: I) -> &mut [T][src]

Trait Implementations

impl Default for DroplessArena[src]

impl Send for DroplessArena[src]

Auto Trait Implementations

impl !RefUnwindSafe for DroplessArena[src]

impl !Sync for DroplessArena[src]

impl Unpin for DroplessArena[src]

impl UnwindSafe for DroplessArena[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.