pub struct Arena { /* private fields */ }Expand description
Pre-allocated memory arena for graph execution.
Implementations§
Source§impl Arena
impl Arena
Sourcepub fn from_plan(plan: MemoryPlan) -> Self
pub fn from_plan(plan: MemoryPlan) -> Self
Allocate arena from a memory plan.
Sourcepub fn slice_mut_f64(&mut self, id: NodeId) -> &mut [f64]
pub fn slice_mut_f64(&mut self, id: NodeId) -> &mut [f64]
Get a mutable f64 slice for a node’s buffer.
§Panics
Panics if the node has no buffer assignment, or if the slot’s byte size is not 8-aligned.
Sourcepub fn has_buffer(&self, id: NodeId) -> bool
pub fn has_buffer(&self, id: NodeId) -> bool
Check if a node has a buffer assignment.
Sourcepub fn raw_ptr(&self, id: NodeId) -> (*mut f32, usize)
pub fn raw_ptr(&self, id: NodeId) -> (*mut f32, usize)
Get a raw pointer + length for a node’s buffer. SAFETY: caller must ensure no aliasing writes to the same buffer.
Sourcepub fn byte_offset(&self, id: NodeId) -> usize
pub fn byte_offset(&self, id: NodeId) -> usize
Byte offset of a node’s buffer within the arena.
Sourcepub fn raw_buf_mut(&mut self) -> &mut [u8] ⓘ
pub fn raw_buf_mut(&mut self) -> &mut [u8] ⓘ
Raw mutable access to the arena buffer (for thunk executor).
Sourcepub fn raw_buf_mut_ptr(&self) -> *const u8
pub fn raw_buf_mut_ptr(&self) -> *const u8
Raw pointer to arena start (for zero-copy output reads).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Arena
impl RefUnwindSafe for Arena
impl Send for Arena
impl Sync for Arena
impl Unpin for Arena
impl UnsafeUnpin for Arena
impl UnwindSafe for Arena
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more