Skip to content

Commit 25efa36

Browse files
committed
Remove MemoryMarker
`MemoryMarker::shrink` may result in unexpected behavior when an allocator like `Region` shrinks it's memory with `ptr::copy` rather then `ptr::copy_nonoverlapping`. Until I come up with a solution to this I remove `MemoryMarker`
1 parent 8eb6e64 commit 25efa36

File tree

4 files changed

+5
-161
lines changed

4 files changed

+5
-161
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [v0.5](https://timdiekmann.github.io/alloc-compose/alloc_compose/index.html) (Unreleased)
22

33
- **Breaking Change** Add `AllocAll` trait and move some methods from `Region` into that trait
4+
- **Breaking Change** Remove `MemoryMarker`
45

56
## [v0.4](https://docs.rs/alloc-compose/0.4)
67

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ mod affix;
2222
mod callback_ref;
2323
mod chunk;
2424
mod fallback;
25-
mod memory_marker;
2625
mod null;
2726
mod proxy;
2827
mod region;
@@ -38,7 +37,6 @@ pub use self::{
3837
callback_ref::CallbackRef,
3938
chunk::Chunk,
4039
fallback::Fallback,
41-
memory_marker::MemoryMarker,
4240
null::Null,
4341
proxy::Proxy,
4442
region::Region,

src/memory_marker.rs

-155
This file was deleted.

src/stats.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ impl_filtered_callback_ref!(FilteredAtomicCounter);
625625
mod tests {
626626
use super::{AtomicCounter, Counter, FilteredAtomicCounter, FilteredCounter};
627627
use crate::{helper, CallbackRef, Owns, Proxy, Region};
628-
use std::alloc::{AllocErr, System, AllocInit, AllocRef, Layout, ReallocPlacement};
628+
use std::alloc::{AllocErr, AllocInit, AllocRef, Layout, ReallocPlacement, System};
629629

630630
#[allow(clippy::too_many_lines)]
631631
fn run_suite(callbacks: &impl CallbackRef) {
@@ -648,8 +648,8 @@ mod tests {
648648

649649
unsafe {
650650
let memory_tmp = alloc
651-
.alloc(Layout::new::<[u8; 4]>(), AllocInit::Zeroed)
652-
.unwrap();
651+
.alloc(Layout::new::<[u8; 4]>(), AllocInit::Zeroed)
652+
.unwrap();
653653
alloc.dealloc(memory_tmp.ptr, Layout::new::<[u8; 4]>());
654654
}
655655
unsafe {
@@ -765,7 +765,7 @@ mod tests {
765765
)
766766
.unwrap();
767767

768-
assert!(alloc.owns(memory));
768+
assert!(alloc.owns(memory));
769769
alloc.dealloc(memory.ptr, Layout::new::<[u8; 4]>());
770770
assert!(!alloc.owns(memory));
771771
}

0 commit comments

Comments
 (0)