From d3b7b5172a7b7bbbd9050a32f1571677db03b43a Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Wed, 19 Mar 2025 00:54:02 -0700 Subject: [PATCH] Use u32 for offset field of Allocation The offset field is a unit offset, not a node index. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 98ab025..89244e8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,7 +78,7 @@ where NI: NodeIndex, { /// The location of this allocation within the buffer. - pub offset: NI, + pub offset: u32, /// The node index associated with this allocation. metadata: NI::NonMax, } @@ -291,7 +291,7 @@ where let node = &mut self.nodes[node_index.to_usize()]; Some(Allocation { - offset: NI::from_u32(node.data_offset), + offset: node.data_offset, metadata: node_index, }) }