Skip to content

Commit 4b809e2

Browse files
committed
Fix mi_usable_size gating
mi_usable_size was gated behind the extended feature in 310ffbe#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759 but one test, `it_calculates_usable_size` was left behind in `lib.rs`. Move it to `extended.rs` as well. Signed-off-by: Michel Lind <salimma@fedoraproject.org>
1 parent a9c410c commit 4b809e2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

libmimalloc-sys/src/extended.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,16 @@ extern "C" {
10131013
mod tests {
10141014
use super::*;
10151015

1016+
#[test]
1017+
fn it_calculates_usable_size() {
1018+
let ptr = unsafe { mi_malloc(32) } as *mut u8;
1019+
let usable_size = unsafe { mi_usable_size(ptr as *mut c_void) };
1020+
assert!(
1021+
usable_size >= 32,
1022+
"usable_size should at least equal to the allocated size"
1023+
);
1024+
}
1025+
10161026
#[test]
10171027
fn runtime_stable_option() {
10181028
unsafe {

libmimalloc-sys/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,4 @@ mod tests {
8989
let ptr = unsafe { mi_realloc_aligned(ptr as *mut c_void, 8, 8) } as *mut u8;
9090
unsafe { mi_free(ptr as *mut c_void) };
9191
}
92-
93-
#[test]
94-
fn it_calculates_usable_size() {
95-
let ptr = unsafe { mi_malloc(32) } as *mut u8;
96-
let usable_size = unsafe { mi_usable_size(ptr as *mut c_void) };
97-
assert!(
98-
usable_size >= 32,
99-
"usable_size should at least equal to the allocated size"
100-
);
101-
}
10292
}

0 commit comments

Comments
 (0)