Commit c1e748bd authored by Russ Cox's avatar Russ Cox

embarassing bug in allocator:

was applying wrong waste check,
resulting in many more size classes
than necessary.

R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=26602
CL=26605
parent 90943c8e
...@@ -91,7 +91,7 @@ typedef uintptr PageID; // address >> PageShift ...@@ -91,7 +91,7 @@ typedef uintptr PageID; // address >> PageShift
enum enum
{ {
// Tunable constants. // 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, MaxSmallSize = 32<<10,
FixAllocChunk = 128<<10, // Chunk size for FixAlloc FixAllocChunk = 128<<10, // Chunk size for FixAlloc
......
...@@ -82,7 +82,7 @@ InitSizes(void) ...@@ -82,7 +82,7 @@ InitSizes(void)
// so wasted space is at most 12.5%. // so wasted space is at most 12.5%.
allocsize = PageSize; allocsize = PageSize;
osize = size + RefcountOverhead; osize = size + RefcountOverhead;
while(allocsize%osize > (PageSize/8)) while(allocsize%osize > (allocsize/8))
allocsize += PageSize; allocsize += PageSize;
npages = allocsize >> PageShift; npages = allocsize >> PageShift;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment