Skip to content

Commit

Permalink
Merge pull request #73 from evanrichter/fuzz-for-fragmentation
Browse files Browse the repository at this point in the history
detect fragmentation when fuzzing
  • Loading branch information
phil-opp authored Nov 14, 2022
2 parents e4b0b8d + 68bc1af commit f7c2d8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fuzz/fuzz_targets/chaos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,8 @@ fn fuzz(size: u16, actions: Vec<Action>) {
heap.deallocate(ptr, layout);
}
}

// make sure we can allocate the full heap (no fragmentation)
let full = Layout::from_size_align(heap.size(), 1).unwrap();
assert!(heap.allocate_first_fit(full).is_ok());
}

0 comments on commit f7c2d8e

Please sign in to comment.