diff --git a/src/mem/largealloc.h b/src/mem/largealloc.h index 3c8dd718..11aa6e0c 100644 --- a/src/mem/largealloc.h +++ b/src/mem/largealloc.h @@ -196,13 +196,15 @@ namespace snmalloc memory_provider.template zero(p, OS_PAGE_SIZE); memory_provider.template notify_using( - (void*)((size_t)p + OS_PAGE_SIZE), size - OS_PAGE_SIZE); + (void*)((size_t)p + OS_PAGE_SIZE), + bits::align_up(size, OS_PAGE_SIZE) - OS_PAGE_SIZE); } else { // This is a superslab that has not been decommitted. if (zero_mem == YesZero) - memory_provider.template zero(p, size); + memory_provider.template zero( + p, bits::align_up(size, OS_PAGE_SIZE)); } }