[−][src]Struct basic_allocator::allocators::RawAlloc
A raw allocator, capable of growing the heap, returning pointers to new allocations, and tracking and reusing freed memory.
Note: It never returns memory to the OS; that is not implemented.
This roughly corresponds to the
AllocRef
trait in Rust nightly, but does not directly implement that trait (although
it probably could... TODO!)
Fields
grower: G
blocks: BlockList
Implementations
impl<G: HeapGrower> RawAlloc<G>
[src]
pub fn new(grower: G) -> Self
[src]
Create a new RawAlloc
pub fn stats(&self) -> (Validity, Stats)
[src]
Get statistics on this allocator, and verify validity of the BlockList
pub fn block_size(layout: Layout) -> usize
[src]
Calculate the minimum size of a block to be allocated for the given layout.
pub unsafe fn alloc(&mut self, layout: Layout) -> *mut u8
[src]
Allocate space for something fitting in layout
Safety
This is very unsafe. See GlobalAlloc for details.
pub unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout)
[src]
Trait Implementations
Auto Trait Implementations
impl<G> Send for RawAlloc<G> where
G: Send,
G: Send,
impl<G> !Sync for RawAlloc<G>
impl<G> Unpin for RawAlloc<G> where
G: Unpin,
G: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,