]> Cypherpunks repositories - gostls13.git/commit
runtime: shrink bigger stacks without any copying.
authorKeith Randall <khr@golang.org>
Fri, 7 Mar 2014 00:03:43 +0000 (16:03 -0800)
committerKeith Randall <khr@golang.org>
Fri, 7 Mar 2014 00:03:43 +0000 (16:03 -0800)
commitf4359afa7f7886541a51c44cefee39250a202d65
tree3f683195c9b7b2e135b476e4866f2803cc7dd263
parent9abcd53eda0629d009941027ffa2dc680b5f1d00
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
src/pkg/runtime/malloc.h
src/pkg/runtime/mheap.c
src/pkg/runtime/stack.c