Made alignment a template parameter.
This commit is contained in:
@@ -68,7 +68,8 @@ namespace snmalloc
|
||||
* Primitive allocator for structure that are required before
|
||||
* the allocator can be running.
|
||||
***/
|
||||
void* alloc_chunk(size_t size, size_t alignment = 64)
|
||||
template<size_t alignment = 64>
|
||||
void* alloc_chunk(size_t size)
|
||||
{
|
||||
// Cache line align
|
||||
size = bits::align_up(size, 64);
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace snmalloc
|
||||
{
|
||||
auto& v = default_memory_provider;
|
||||
value =
|
||||
(PagemapEntry*)v.alloc_chunk(PAGEMAP_NODE_SIZE, OS_PAGE_SIZE);
|
||||
(PagemapEntry*)v.alloc_chunk<OS_PAGE_SIZE>(PAGEMAP_NODE_SIZE);
|
||||
e->store(value, std::memory_order_release);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user