We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b9a525 commit adeecfbCopy full SHA for adeecfb
1 file changed
src/mem/largealloc.h
@@ -196,13 +196,15 @@ namespace snmalloc
196
memory_provider.template zero<true>(p, OS_PAGE_SIZE);
197
198
memory_provider.template notify_using<zero_mem>(
199
- (void*)((size_t)p + OS_PAGE_SIZE), size - OS_PAGE_SIZE);
+ (void*)((size_t)p + OS_PAGE_SIZE),
200
+ bits::align_up(size, OS_PAGE_SIZE) - OS_PAGE_SIZE);
201
}
202
else
203
{
204
// This is a superslab that has not been decommitted.
205
if (zero_mem == YesZero)
- memory_provider.template zero<true>(p, size);
206
+ memory_provider.template zero<true>(
207
+ p, bits::align_up(size, OS_PAGE_SIZE));
208
209
210
0 commit comments