We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b75e917 commit 029a294Copy full SHA for 029a294
tests/run-pass/malloc.rs renamed to tests/run-pass-noseed/malloc.rs
@@ -11,10 +11,8 @@ fn main() {
11
// Test that small allocations sometimes *are* not very aligned.
12
let saw_unaligned = (0..64).any(|_| unsafe {
13
let p = libc::malloc(3);
14
- let addr = p as usize;
15
- let unaligned = addr % 4 != 0; // test that this is not 4-aligned
16
- libc::free(p); // FIXME have to free *after* test; should allow ptr-to-int of dangling ptr.
17
- unaligned
+ libc::free(p);
+ (p as usize) % 4 != 0 // find any that this is *not* 4-aligned
18
});
19
assert!(saw_unaligned);
20
0 commit comments