about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-04 07:54:34 +0200
committerGitHub <noreply@github.com>2025-06-04 07:54:34 +0200
commite63e53a3f64051a80d47e42ea56e740c8879100d (patch)
tree33146426c0d1a8bfeff4f0308a843dbb07d9b4e7 /src
parent88620b400e0dceb982af11f2309516ef088cbffa (diff)
parenta0c19ee577542cbc9dbdead54c91e661aa6396de (diff)
downloadrust-e63e53a3f64051a80d47e42ea56e740c8879100d.tar.gz
rust-e63e53a3f64051a80d47e42ea56e740c8879100d.zip
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`
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/src/alloc/isolated_alloc.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/tools/miri/src/alloc/isolated_alloc.rs b/src/tools/miri/src/alloc/isolated_alloc.rs
index 7b74d171373..3a7879f372a 100644
--- a/src/tools/miri/src/alloc/isolated_alloc.rs
+++ b/src/tools/miri/src/alloc/isolated_alloc.rs
@@ -145,10 +145,7 @@ impl IsolatedAlloc {
             if pinfo.domain_size() < offset_pinfo + size_pinfo {
                 break;
             }
-            // FIXME: is there a more efficient way to check whether the entire range is unset
-            // in the bitset?
-            let range_avail = !(offset_pinfo..offset_pinfo + size_pinfo).any(|i| pinfo.contains(i));
-            if range_avail {
+            if !pinfo.contains_any(offset_pinfo..offset_pinfo + size_pinfo) {
                 pinfo.insert_range(offset_pinfo..offset_pinfo + size_pinfo);
                 // SAFETY: We checked the available bytes after `idx` in the call
                 // to `domain_size` above and asserted there are at least `idx +