From: Shenghou Ma Date: Tue, 11 Jun 2013 21:22:49 +0000 (+0800) Subject: runtime: round spans_size up to page boundary X-Git-Tag: go1.2rc2~1273 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ccd1d07cc44f3ca033ab7ad9e93ebf97ff3fa94c;p=gostls13.git runtime: round spans_size up to page boundary in case we have weird (not page aligned) memory limit. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/10199043 --- diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc index 4d900d63b9..a1db66e1ad 100644 --- a/src/pkg/runtime/malloc.goc +++ b/src/pkg/runtime/malloc.goc @@ -351,6 +351,8 @@ runtime·mallocinit(void) arena_size = MaxMem; bitmap_size = arena_size / (sizeof(void*)*8/4); spans_size = arena_size / PageSize * sizeof(runtime·mheap.spans[0]); + // round spans_size to pages + spans_size = (spans_size + ((1<