Skip to content

Commit ab0383f

Browse files
committed
Revert "test: add test case cannot_alloc_max_usize_minus_some"
This reverts commit 77b0c40. Constructing such bug `Layout`s is now refused by `Layout:: from_size_align` as of [rust-lang/rust#95295][1]. [1]: rust-lang/rust#95295
1 parent dd8b212 commit ab0383f

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

crates/rlsf/tests/global.rs

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Adopted from
22
// https://github.com/alexcrichton/dlmalloc-rs/blob/master/tests/global.rs
3-
use std::{
4-
alloc::{GlobalAlloc, Layout},
5-
collections::HashMap,
6-
};
3+
use std::collections::HashMap;
74

85
#[global_allocator]
96
#[cfg(any(all(target_arch = "wasm32", not(target_feature = "atomics")), unix))]
@@ -55,15 +52,3 @@ fn test_larger_than_word_alignment() {
5552
}
5653
}
5754
}
58-
59-
#[test]
60-
fn cannot_alloc_max_usize_minus_some() {
61-
// The test should complete without causing OOM
62-
for offset in (0..64).step_by(8) {
63-
let layout = Layout::from_size_align(usize::MAX - offset, 1).unwrap();
64-
for _ in 0..1000000 {
65-
let result = unsafe { A.alloc(layout) };
66-
assert!(result.is_null());
67-
}
68-
}
69-
}

0 commit comments

Comments
 (0)