pub struct MemoryPlan {
pub arena_size: usize,
pub assignments: HashMap<NodeId, BufferSlot>,
pub schedule: Vec<NodeId>,
}Expand description
Complete memory plan for executing a graph.
Fields§
§arena_size: usizeTotal arena size in bytes.
assignments: HashMap<NodeId, BufferSlot>Buffer assignment: NodeId → offset within arena.
schedule: Vec<NodeId>Node execution order (topological).
Implementations§
Source§impl MemoryPlan
impl MemoryPlan
Sum of all assigned buffer sizes (i.e. how much memory the plan would use if every node had its own slot). Useful for reporting how much the liveness-aware sharing saved.
Sourcepub fn bytes_saved(&self) -> usize
pub fn bytes_saved(&self) -> usize
Bytes saved vs. naive “every node gets its own slot” — how much the liveness analysis bought you.
Sourcepub fn report(&self) -> String
pub fn report(&self) -> String
Render the buffer plan as a one-line-per-node table for debugging — sorted by offset so adjacent buffers in memory are adjacent in the report (plan #87).
The output is parseable: <offset>\t<size>\t%<node_id>. Pipe
through column -t for human display, or grep / awk it for
scripted analysis.
Trait Implementations§
Source§impl Clone for MemoryPlan
impl Clone for MemoryPlan
Source§fn clone(&self) -> MemoryPlan
fn clone(&self) -> MemoryPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryPlan
impl Debug for MemoryPlan
Source§impl From<&LirBufferPlan> for MemoryPlan
impl From<&LirBufferPlan> for MemoryPlan
Source§fn from(plan: &LirBufferPlan) -> Self
fn from(plan: &LirBufferPlan) -> Self
Converts to this type from the input type.
Source§impl From<&MemoryPlan> for LirBufferPlan
impl From<&MemoryPlan> for LirBufferPlan
Source§fn from(plan: &MemoryPlan) -> Self
fn from(plan: &MemoryPlan) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MemoryPlan
impl RefUnwindSafe for MemoryPlan
impl Send for MemoryPlan
impl Sync for MemoryPlan
impl Unpin for MemoryPlan
impl UnsafeUnpin for MemoryPlan
impl UnwindSafe for MemoryPlan
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