Skip to content

Commit 16c92d9

Browse files
authored
Rollup merge of #141871 - nia-e:fix-bitset, r=eholk
index: add method for checking range on DenseBitSet Micro-optimisation that Miri benefits from with the new isolated allocator for native-libs mode. Also possibly just a useful method to have on `DenseBitSet`
2 parents 69befaf + fff58b5 commit 16c92d9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/alloc/isolated_alloc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,7 @@ impl IsolatedAlloc {
145145
if pinfo.domain_size() < offset_pinfo + size_pinfo {
146146
break;
147147
}
148-
// FIXME: is there a more efficient way to check whether the entire range is unset
149-
// in the bitset?
150-
let range_avail = !(offset_pinfo..offset_pinfo + size_pinfo).any(|i| pinfo.contains(i));
151-
if range_avail {
148+
if !pinfo.contains_any(offset_pinfo..offset_pinfo + size_pinfo) {
152149
pinfo.insert_range(offset_pinfo..offset_pinfo + size_pinfo);
153150
// SAFETY: We checked the available bytes after `idx` in the call
154151
// to `domain_size` above and asserted there are at least `idx +

0 commit comments

Comments
 (0)