pub struct MemoryPlan {
pub assignments: Vec<SlotAssignment>,
pub slot_sizes: Vec<usize>,
pub total_bytes: usize,
pub num_slots: usize,
pub external_count: usize,
}Expand description
The complete memory allocation plan for a graph.
Fields§
§assignments: Vec<SlotAssignment>Per-buffer slot assignments.
slot_sizes: Vec<usize>Slot sizes in bytes (indexed by slot id).
total_bytes: usizeTotal pool size required (= sum of slot sizes, aligned).
num_slots: usizeNumber of distinct slots (= colouring number of the interval graph).
external_count: usizeNumber of external buffers (not managed by the pool).
Implementations§
Source§impl MemoryPlan
impl MemoryPlan
Sourcepub fn assignment(&self, buf: BufferId) -> Option<&SlotAssignment>
pub fn assignment(&self, buf: BufferId) -> Option<&SlotAssignment>
Returns the slot assignment for a buffer, or None if unassigned.
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Returns the memory reduction factor (original sum of sizes vs pool size).
A value of 0.5 means the pool is 50% of the naive sum (2× memory saved).
Returns 1.0 if no buffers are managed.
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 moreAuto 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