aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-11-13 12:45:08 -0500
committerRuss Cox <rsc@golang.org>2012-11-13 12:45:08 -0500
commit9799a5a4fd6ec85c52c48e73cb197006ca06c32e (patch)
tree0fc27c979700260e20f909cad6ccbb66bc914b6d /src/pkg/runtime/malloc.h
parentfc5e64cb8f790c559a6f6c8801a8e1f03aee21a5 (diff)
downloadgo-9799a5a4fd6ec85c52c48e73cb197006ca06c32e.tar.xz
runtime: allow up to 128 GB of allocated memory
Incorporates code from CL 6828055. Fixes #2142. R=golang-dev, iant, devon.odell CC=golang-dev https://golang.org/cl/6826088
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index 765cd02eb2..916b473a00 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -114,12 +114,12 @@ enum
HeapAllocChunk = 1<<20, // Chunk size for heap growth
// Number of bits in page to span calculations (4k pages).
- // On 64-bit, we limit the arena to 16G, so 22 bits suffices.
- // On 32-bit, we don't bother limiting anything: 20 bits for 4G.
+ // On 64-bit, we limit the arena to 128GB, or 37 bits.
+ // On 32-bit, we don't bother limiting anything, so we use the full 32-bit address.
#ifdef _64BIT
- MHeapMap_Bits = 22,
+ MHeapMap_Bits = 37 - PageShift,
#else
- MHeapMap_Bits = 20,
+ MHeapMap_Bits = 32 - PageShift,
#endif
// Max number of threads to run garbage collection.
@@ -133,7 +133,7 @@ enum
// This must be a #define instead of an enum because it
// is so large.
#ifdef _64BIT
-#define MaxMem (16ULL<<30) /* 16 GB */
+#define MaxMem (1ULL<<(MHeapMap_Bits+PageShift)) /* 128 GB */
#else
#define MaxMem ((uintptr)-1)
#endif