Skip to content

Commit f7c2d8e

Browse files
authored
Merge pull request rust-osdev#73 from evanrichter/fuzz-for-fragmentation
detect fragmentation when fuzzing
2 parents e4b0b8d + 68bc1af commit f7c2d8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fuzz/fuzz_targets/chaos.rs

+4
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,8 @@ fn fuzz(size: u16, actions: Vec<Action>) {
117117
heap.deallocate(ptr, layout);
118118
}
119119
}
120+
121+
// make sure we can allocate the full heap (no fragmentation)
122+
let full = Layout::from_size_align(heap.size(), 1).unwrap();
123+
assert!(heap.allocate_first_fit(full).is_ok());
120124
}

0 commit comments

Comments
 (0)