Remove at_least

The Pal was providing policy for overallocating a block of memory to
achieve alignment make that part of the backend.
The backend should be responsible for layout policy.
This commit is contained in:
Matthew Parkinson
2021-07-19 11:20:02 +01:00
committed by Matthew Parkinson
parent 9df0101dfd
commit 5d0ae71423
10 changed files with 50 additions and 68 deletions

View File

@@ -21,7 +21,8 @@ int main()
// 28 is large enough to produce a nested allocator.
// It is also large enough for the example to run in.
// For 1MiB superslabs, SUPERSLAB_BITS + 4 is not big enough for the example.
auto [oe_base, size] = Pal::reserve_at_least(bits::one_at_bit(28));
auto size = bits::one_at_bit(28);
auto oe_base = Pal::reserve(size);
Pal::notify_using<NoZero>(oe_base, size);
auto oe_end = pointer_offset(oe_base, size);
std::cout << "Allocated region " << oe_base << " - "

View File

@@ -68,7 +68,8 @@ void test_pagemap(bool bounded)
// Initialise the pagemap
if (bounded)
{
auto [base, size] = Pal::reserve_at_least(bits::one_at_bit(30));
auto size = bits::one_at_bit(30);
auto base = Pal::reserve(size);
Pal::notify_using<NoZero>(base, size);
std::cout << "Fixed base: " << base << " (" << size << ") "
<< " end: " << pointer_offset(base, size) << std::endl;