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

@@ -68,8 +68,6 @@ namespace snmalloc
// Used to isolate values on cache lines to prevent false sharing.
static constexpr size_t CACHELINE_SIZE = 64;
static constexpr size_t PAGE_ALIGNED_SIZE = OS_PAGE_SIZE << INTERMEDIATE_BITS;
// Minimum allocation size is space for two pointers.
static_assert(bits::next_pow2_const(sizeof(void*)) == sizeof(void*));
static constexpr size_t MIN_ALLOC_SIZE = 2 * sizeof(void*);