-const void* MC_process_read_dynar_element(mc_process_t process,
- void* local, const void* remote_dynar, size_t i, size_t len)
-{
- s_xbt_dynar_t d;
- process->read_bytes(&d, sizeof(d), remote(remote_dynar));
- if (i >= d.used)
- xbt_die("Out of bound index %zi/%lu", i, d.used);
- if (len != d.elmsize)
- xbt_die("Bad size in MC_process_read_dynar_element");
- process->read_bytes(local, len, remote(xbt_dynar_get_ptr(&d, i)));
- return local;
-}
+ unsigned int cursor = 0;
+ IgnoredRegion* current_region = nullptr;
+
+ int start = 0;
+ int end = ignored_regions_.size() - 1;
+ while (start <= end) {
+ cursor = (start + end) / 2;
+ current_region = &ignored_regions_[cursor];
+ if (current_region->addr == addr) {
+ if (current_region->size == size)
+ return;
+ else if (current_region->size < size)
+ start = cursor + 1;
+ else
+ end = cursor - 1;
+ } else if (current_region->addr < addr)
+ start = cursor + 1;
+ else
+ end = cursor - 1;
+ }