*_end = region;
++_end;
+ _combined_size += region.size();
}
void
return;
}
- if (mem.begin() >= _upper_limit)
+ if (_combined_size >= _max_combined_size)
{
- printf(" Dropping %s region ", _name);
+ printf(" Dropping '%s' region ", _name);
mem.print();
- printf(" due to %lld MB limit\n", _upper_limit >> 20);
+ printf(" due to %lld MB limit\n", _max_combined_size >> 20);
return;
}
- if (mem.end() >= _upper_limit - 1)
+ if (_combined_size + mem.size() > _max_combined_size)
{
- printf(" Limiting %s region ", _name);
+ printf(" Limiting '%s' region ", _name);
mem.print();
- mem.end(_upper_limit - 1);
+ mem.end(mem.begin() + _max_combined_size - _combined_size - 1);
printf(" to ");
mem.print();
- printf(" due to %lld MB limit\n", _upper_limit >> 20);
+ printf(" due to %lld MB limit\n", _max_combined_size >> 20);
}
add_nolimitcheck(mem, may_overlap);
void
Region::print() const
{
- printf(" [%9llx, %9llx] {%9llx}", begin(), end(), end() - begin() + 1);
+ printf(" [%9llx, %9llx] {%9llx}", begin(), end(), size());
}
void