aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-03-06 16:03:43 -0800
committerKeith Randall <khr@golang.org>2014-03-06 16:03:43 -0800
commitf4359afa7f7886541a51c44cefee39250a202d65 (patch)
tree3f683195c9b7b2e135b476e4866f2803cc7dd263 /src/pkg/runtime/malloc.h
parent9abcd53eda0629d009941027ffa2dc680b5f1d00 (diff)
downloadgo-f4359afa7f7886541a51c44cefee39250a202d65.tar.xz
runtime: shrink bigger stacks without any copying.
Instead, split the underlying storage in half and free just half of it. Shrinking without copying lets us reclaim storage used by a previously profligate Go routine that has now blocked inside some C code. To shrink in place, we need all stacks to be a power of 2 in size. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/69580044
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index 7583b4b4e3..eb11cced68 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -525,6 +525,7 @@ 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·MHeap_SplitSpan(MHeap *h, MSpan *s);
void* runtime·mallocgc(uintptr size, uintptr typ, uint32 flag);
void* runtime·persistentalloc(uintptr size, uintptr align, uint64 *stat);