diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:53:27 +0100 |
commit | 91664defe0a75da15661a37a7f585b0c8523bf4e (patch) | |
tree | 8d7133037ce477c00ba0408d3f0892e0a8b5744d /src/pkg/runtime/msize.c | |
parent | ac2d3c9eb73a2d23848c55c3171d8ff6dd0feed9 (diff) | |
download | golang-91664defe0a75da15661a37a7f585b0c8523bf4e.tar.gz |
Imported Upstream version 2011.02.15
Diffstat (limited to 'src/pkg/runtime/msize.c')
-rw-r--r-- | src/pkg/runtime/msize.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pkg/runtime/msize.c b/src/pkg/runtime/msize.c index ec85eb373..770ef38ce 100644 --- a/src/pkg/runtime/msize.c +++ b/src/pkg/runtime/msize.c @@ -57,7 +57,7 @@ runtime·SizeToClass(int32 size) void runtime·InitSizes(void) { - int32 align, sizeclass, size, osize, nextsize, n; + int32 align, sizeclass, size, nextsize, n; uint32 i; uintptr allocsize, npages; @@ -81,8 +81,7 @@ runtime·InitSizes(void) // the leftover is less than 1/8 of the total, // so wasted space is at most 12.5%. allocsize = PageSize; - osize = size + RefcountOverhead; - while(allocsize%osize > (allocsize/8)) + while(allocsize%size > allocsize/8) allocsize += PageSize; npages = allocsize >> PageShift; @@ -93,7 +92,7 @@ runtime·InitSizes(void) // different sizes. if(sizeclass > 1 && npages == runtime·class_to_allocnpages[sizeclass-1] - && allocsize/osize == allocsize/(runtime·class_to_size[sizeclass-1]+RefcountOverhead)) { + && allocsize/size == allocsize/runtime·class_to_size[sizeclass-1]) { runtime·class_to_size[sizeclass-1] = size; continue; } |