Make Pals only return amount of memory requested

The PAL API previously allowed for returning more memory than asked for.
This was when the PAL performed the alignment work, now this is done in
large alloc, so removing from the PAL.
This commit is contained in:
Matthew Parkinson
2020-01-28 14:47:40 +00:00
parent 6e8edefc99
commit 4fea7b8bb1
10 changed files with 27 additions and 37 deletions

View File

@@ -33,7 +33,7 @@ int main()
MemoryProviderStateMixin<DefaultPal> mp;
size_t size = 1ULL << 28;
oe_base = mp.reserve<true>(&size, 0);
oe_base = mp.reserve<true>(size, 1);
oe_end = (uint8_t*)oe_base + size;
std::cout << "Allocated region " << oe_base << " - " << oe_end << std::endl;

View File

@@ -46,7 +46,7 @@ int main()
MemoryProviderStateMixin<DefaultPal> mp;
size_t size = 1ULL << 26;
oe_base = mp.reserve<true>(&size, 1);
oe_base = mp.reserve<true>(size, 1);
oe_end = (uint8_t*)oe_base + size;
std::cout << "Allocated region " << oe_base << " - " << oe_end << std::endl;