From dd557c8f293dbef3e2e881bcb1a85a7697a1ebbb Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 23 Feb 2025 08:47:17 +0000 Subject: fix memory leak in simulation tests (lol) also, change some vecs into boxed slices, and add RelativeEntityUpdate::new --- azalea-world/src/bit_storage.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'azalea-world/src/bit_storage.rs') diff --git a/azalea-world/src/bit_storage.rs b/azalea-world/src/bit_storage.rs index 2af7427d..1b0c1a56 100755 --- a/azalea-world/src/bit_storage.rs +++ b/azalea-world/src/bit_storage.rs @@ -72,7 +72,7 @@ const MAGIC: [(i32, i32, i32); 64] = [ /// A compact list of integers with the given number of bits per entry. #[derive(Clone, Debug, Default)] pub struct BitStorage { - pub data: Vec, + pub data: Box<[u64]>, bits: usize, mask: u64, size: usize, @@ -106,7 +106,7 @@ impl BitStorage { // 0 bit storage if data.is_empty() { return Ok(BitStorage { - data: Vec::new(), + data: Box::new([]), bits, size, ..Default::default() @@ -136,7 +136,7 @@ impl BitStorage { }; Ok(BitStorage { - data: using_data, + data: using_data.into(), bits, mask, size, -- cgit v1.2.3