From a78a16e6374426d1a547bab117ee4c849ba90a44 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 31 May 2022 15:21:28 +0100 Subject: [PATCH] smallbuddy ranges are only for small things Now that we've split the range Pipe-line externally, the small-buddy ranges should never be seeing large requests. --- src/snmalloc/backend_helpers/smallbuddyrange.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/snmalloc/backend_helpers/smallbuddyrange.h b/src/snmalloc/backend_helpers/smallbuddyrange.h index c35abeab..f19163b4 100644 --- a/src/snmalloc/backend_helpers/smallbuddyrange.h +++ b/src/snmalloc/backend_helpers/smallbuddyrange.h @@ -204,10 +204,7 @@ namespace snmalloc CapPtr alloc_range(size_t size) { - if (size >= MIN_CHUNK_SIZE) - { - return parent.alloc_range(size); - } + SNMALLOC_ASSERT(size < MIN_CHUNK_SIZE); auto result = buddy_small.remove_block(size); if (result != nullptr) @@ -221,7 +218,7 @@ namespace snmalloc CapPtr alloc_range_with_leftover(size_t size) { - SNMALLOC_ASSERT(size <= MIN_CHUNK_SIZE); + SNMALLOC_ASSERT(size < MIN_CHUNK_SIZE); auto rsize = bits::next_pow2(size); @@ -239,11 +236,7 @@ namespace snmalloc void dealloc_range(CapPtr base, size_t size) { - if (size >= MIN_CHUNK_SIZE) - { - parent.dealloc_range(base, size); - return; - } + SNMALLOC_ASSERT(size < MIN_CHUNK_SIZE); add_range(base, size); }