diff --git a/src/runtime/malloc.h b/src/runtime/malloc.h index d1d9e95e98f..530dfc98f1f 100644 --- a/src/runtime/malloc.h +++ b/src/runtime/malloc.h @@ -91,7 +91,7 @@ typedef uintptr PageID; // address >> PageShift enum { // Tunable constants. - NumSizeClasses = 150, // Number of size classes (must match msize.c) + NumSizeClasses = 67, // Number of size classes (must match msize.c) MaxSmallSize = 32<<10, FixAllocChunk = 128<<10, // Chunk size for FixAlloc diff --git a/src/runtime/msize.c b/src/runtime/msize.c index 62d5c3ad99b..25e22637d28 100644 --- a/src/runtime/msize.c +++ b/src/runtime/msize.c @@ -82,7 +82,7 @@ InitSizes(void) // so wasted space is at most 12.5%. allocsize = PageSize; osize = size + RefcountOverhead; - while(allocsize%osize > (PageSize/8)) + while(allocsize%osize > (allocsize/8)) allocsize += PageSize; npages = allocsize >> PageShift;