diff --git a/Cargo.toml b/Cargo.toml index c72197d7..72e3ccf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,6 @@ encoding_rs = "0.8.13" lazycell = "1.3.0" lazy_static = "1.3.0" memchr = "2.1.2" -safemem = "0.3.3" selectors = "0.22.0" thiserror = "1.0.2" hashbrown = "0.13.1" diff --git a/src/memory/arena.rs b/src/memory/arena.rs index 8e3e2b5f..1cb32f2f 100644 --- a/src/memory/arena.rs +++ b/src/memory/arena.rs @@ -1,5 +1,4 @@ use super::{MemoryLimitExceededError, SharedMemoryLimiter}; -use safemem::copy_over; /// Preallocated region of memory that can grow and never deallocates during the lifetime of /// the limiter. @@ -48,10 +47,8 @@ impl Arena { } pub fn shift(&mut self, byte_count: usize) { - let remainder_len = self.data.len() - byte_count; - - copy_over(&mut self.data, byte_count, 0, remainder_len); - self.data.truncate(remainder_len); + self.data.copy_within(byte_count.., 0); + self.data.truncate(self.data.len() - byte_count); } pub fn bytes(&self) -> &[u8] {