From adeecfb0f1a489acf35badacf7315e128a8f731b Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 14 Feb 2019 19:59:58 +0000 Subject: [PATCH] Added bug fix to alignment of using. --- src/mem/largealloc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mem/largealloc.h b/src/mem/largealloc.h index 3c8dd71..11aa6e0 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)); } }