Skip to content

Commit

Permalink
zero out buffer in clear
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Nov 10, 2024
1 parent 93bdeed commit ddb8b89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rarena-allocator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rarena-allocator"
version = "0.4.17"
version = "0.4.18"
edition.workspace = true
repository.workspace = true
homepage = "https://github.com/al8n/rarena/tree/main/rarena-allocator"
Expand Down
6 changes: 6 additions & 0 deletions rarena-allocator/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ impl<R: RefCounter, PR: PathRefCounter, H: Header> Memory<R, PR, H> {
)
};

core::ptr::write_bytes(
self.ptr.add(data_offset),
0,
self.cap as usize - data_offset,
);

self.header_ptr = header;
self.data_offset = data_offset;
}
Expand Down

0 comments on commit ddb8b89

Please sign in to comment.