Trait dbkit_engine::allocator::Allocator [] [src]

pub trait Allocator: Send + Sync {
    fn allocate(&self, size: usize) -> Result<OwnedChunkDBError>;
    fn allocate_aligned(&self, size: usize, align: usize) -> Result<OwnedChunkDBError>;
    unsafe fn resize<'a>(&self, prev: &mut OwnedChunk<'a>, size: usize) -> Option<DBError>;
    fn putback(&self, data: &mut OwnedChunk);
    fn putback_raw(&self, ptr: *mut u8, size: usize, align: usize);
}

Allocator trait, used through out the operations in dbkit.

Allocators have to maintain their own synchronization

Required Methods

Resize; will try to resize in place if possible

Implementors