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:
committed by
Matthew Parkinson
parent
9df0101dfd
commit
5d0ae71423
@@ -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 << " - "
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace test
|
||||
size = 16;
|
||||
// store object
|
||||
objects[i] = (size_t*)alloc.alloc(size);
|
||||
if (objects[i] == nullptr)
|
||||
abort();
|
||||
// Store allocators size for this object
|
||||
*objects[i] = alloc.alloc_size(objects[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user