Add local caching to chunk allocator

This commit is contained in:
Matthew Parkinson
2021-10-20 16:55:08 +01:00
committed by Matthew Parkinson
parent 20a114cb62
commit 72ccb23d02
5 changed files with 174 additions and 8 deletions

View File

@@ -182,6 +182,7 @@ namespace snmalloc
// Set remote as large allocator remote.
auto [chunk, meta] = ChunkAllocator::alloc_chunk<SharedStateHandle>(
core_alloc->get_backend_local_state(),
core_alloc->chunk_local_state,
bits::next_pow2_bits(size), // TODO
large_size_to_chunk_sizeclass(size),
large_size_to_chunk_size(size),
@@ -547,6 +548,7 @@ namespace snmalloc
size_t slab_sizeclass) {
ChunkAllocator::dealloc<SharedStateHandle>(
core_alloc->get_backend_local_state(),
core_alloc->chunk_local_state,
slab_record,
slab_sizeclass);
return nullptr;