From e6b4efd9805bf76259ef984f6c35fed19970fcf1 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Mon, 12 Aug 2019 18:15:31 +0100 Subject: [PATCH] Don't apply changes to GlobalPlaceholder. --- src/mem/alloc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mem/alloc.h b/src/mem/alloc.h index 155f01a..97b0171 100644 --- a/src/mem/alloc.h +++ b/src/mem/alloc.h @@ -1068,13 +1068,13 @@ namespace snmalloc SNMALLOC_ASSUME(size <= SLAB_SIZE); sizeclass_t sizeclass = size_to_sizeclass(size); - stats().sizeclass_alloc(sizeclass); assert(sizeclass < NUM_SMALL_CLASSES); auto& fl = small_fast_free_lists[sizeclass]; void* head = fl.value; if (likely(head != nullptr)) { + stats().sizeclass_alloc(sizeclass); // Read the next slot from the memory that's about to be allocated. fl.value = Metaslab::follow_next(head); @@ -1097,6 +1097,9 @@ namespace snmalloc return reinterpret_cast(replacement) ->template small_alloc_slow(sizeclass); } + + stats().sizeclass_alloc(sizeclass); + handle_message_queue(); size_t rsize = sizeclass_to_size(sizeclass); auto& sl = small_classes[sizeclass];