Fixed bounds calculation for domestication

Bug: bounds was base,size but code used it as base, end.
This commit is contained in:
Matthew Parkinson
2021-10-18 12:04:09 +01:00
committed by Matthew Parkinson
parent ed10717dde
commit 93bb037c64

View File

@@ -66,10 +66,8 @@ namespace snmalloc
UNUSED(ls);
auto address = address_cast(p);
auto bounds = Backend::Pagemap::get_bounds(nullptr);
if (
(address < bounds.first) || (address > bounds.second) ||
((bounds.second - address) < sz))
auto [base, length] = Backend::Pagemap::get_bounds(nullptr);
if ((address - base > (length - sz)) || (length < sz))
{
return nullptr;
}