[][src]Struct arcon_allocator::Allocator

pub struct Allocator { /* fields omitted */ }

An Allocator for arcon.

The allocator is not meant to handle all heap allocations during the execution. However, it is intended to be used to manage memory for different sections of the runtime. This includes message buffers, network buffers, and state indexes.

Implementations

impl Allocator[src]

pub fn new(limit: usize) -> Allocator[src]

Creates a new Allocator with the given memory limit size

pub unsafe fn alloc<T>(&mut self, capacity: usize) -> AllocResult[src]

Allocate memory block of type T with given capacity

Safety

It is up to the caller to ensure dealloc with the generated AllocId

pub unsafe fn dealloc(&mut self, id: AllocId)[src]

Deallocate memory through the given AllocId

Safety

It is up to the caller to ensure that the given AllocId is active

pub fn allocated_bytes(&self) -> usize[src]

Returns amount of bytes that are currently allocated

pub fn total_allocations(&self) -> u128[src]

Returns total allocations made so far

pub fn bytes_remaining(&self) -> usize[src]

Returns how much bytes are available to allocate

Trait Implementations

impl Debug for Allocator[src]

impl Drop for Allocator[src]

impl Send for Allocator[src]

Auto Trait Implementations

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.