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:
committed by
GitHub
parent
e393ac882f
commit
e16f2aff6f
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user