Add AddressSpaceManager (#214)

This change brings in a new approach to managing address space.
It wraps the Pal with a power of two reservation system, that
guarantees all returned blocks are naturally aligned to their size. It
either lets the Pal perform aligned requests, or over allocates and
splits into power of two blocks.
This commit is contained in:
Matthew Parkinson
2020-06-22 12:36:40 +01:00
committed by GitHub
parent e393ac882f
commit e16f2aff6f
9 changed files with 353 additions and 282 deletions

View File

@@ -60,8 +60,12 @@ namespace snmalloc
}
template<bool committed>
void* reserve(size_t size, size_t align)
void* reserve_aligned(size_t size) noexcept
{
SNMALLOC_ASSERT(size == bits::next_pow2(size));
SNMALLOC_ASSERT(size >= minimum_alloc_size);
size_t align = size;
vm_offset_t addr;
if (vmem_xalloc(
kernel_arena,