diff options
| author | Keith Randall <khr@golang.org> | 2014-03-06 16:03:43 -0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-03-06 16:03:43 -0800 |
| commit | f4359afa7f7886541a51c44cefee39250a202d65 (patch) | |
| tree | 3f683195c9b7b2e135b476e4866f2803cc7dd263 /src/pkg/runtime/malloc.h | |
| parent | 9abcd53eda0629d009941027ffa2dc680b5f1d00 (diff) | |
| download | go-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.h | 1 |
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); |
