[−][src]Struct arcon_allocator::Allocator
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
Auto Trait Implementations
impl RefUnwindSafe for Allocator
[src]
impl !Sync for Allocator
[src]
impl Unpin for Allocator
[src]
impl UnwindSafe for Allocator
[src]
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,
pub 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.
pub 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>,