aboutsummaryrefslogtreecommitdiff
path: root/src/mem/alloc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/alloc.rs')
-rw-r--r--src/mem/alloc.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mem/alloc.rs b/src/mem/alloc.rs
index f3a8c8d..06ca469 100644
--- a/src/mem/alloc.rs
+++ b/src/mem/alloc.rs
@@ -420,6 +420,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U16_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
3..=4 => {
@@ -430,6 +431,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U32_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
5..=8 => {
@@ -440,6 +442,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U64_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
9..=16 => {
@@ -450,6 +453,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U128_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
17..=32 => {
@@ -460,6 +464,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U256_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
33..=64 => {
@@ -470,6 +475,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U512_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
65..=128 => {
@@ -480,6 +486,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U1024_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
129..=256 => {
@@ -490,6 +497,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U2048_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
257..=512 => {
@@ -500,6 +508,7 @@ unsafe impl GlobalAlloc for GrandAllocator {
assert!(index < GRAND_ALLOC_SIZE, "{} is out of the allocation bounds ({})", index, GRAND_ALLOC_SIZE);
assert_eq!(diff % spacing, 0, "{} is not aligned with the spacings and so it must not have been allocated by the Grand Allocator", diff % spacing);
U4096_GRAND_ALLOC.free(&mut pool[index+2]);
+ vprintln!("GA: Freeing ({}, {}, {})", index, diff, spacing);
});
}
_ => {