aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-05-28 22:04:34 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-05-28 22:04:34 +0400
commit671814b9044bebd9f5801cf83df74acbdf31d732 (patch)
treebab95311387449bea4dd43b067288ba839775719 /src/pkg/runtime/malloc.h
parent081129e286fcda2c9525dd08bd90ff6883df0698 (diff)
downloadgo-671814b9044bebd9f5801cf83df74acbdf31d732.tar.xz
runtime: allocate page table lazily
This removes the 256MB memory allocation at startup, which conflicts with ulimit. Also will allow to eliminate an unnecessary memory dereference in GC, because the page table is usually mapped at known address. Update #5049. Update #5236. R=golang-dev, khr, r, khr, rsc CC=golang-dev https://golang.org/cl/9791044
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index b4edf7cbef..2131a7e51c 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -411,7 +411,8 @@ struct MHeap
uint32 nspancap;
// span lookup
- MSpan *map[1<<MHeapMap_Bits];
+ MSpan** map;
+ uintptr spans_mapped;
// range of addresses we might see in the heap
byte *bitmap;
@@ -442,6 +443,7 @@ MSpan* runtime·MHeap_LookupMaybe(MHeap *h, void *v);
void runtime·MGetSizeClassInfo(int32 sizeclass, uintptr *size, int32 *npages, int32 *nobj);
void* runtime·MHeap_SysAlloc(MHeap *h, uintptr n);
void runtime·MHeap_MapBits(MHeap *h);
+void runtime·MHeap_MapSpans(MHeap *h);
void runtime·MHeap_Scavenger(void);
void* runtime·mallocgc(uintptr size, uint32 flag, int32 dogc, int32 zeroed);