]> Cypherpunks repositories - gostls13.git/commit
runtime: keep objects in free lists marked as allocated.
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 13 Aug 2014 16:42:55 +0000 (20:42 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 13 Aug 2014 16:42:55 +0000 (20:42 +0400)
commit187d0f672029e0fa0106024dd2f554b247aa7aff
treeaafd4668d393057cf86b9890ccf4fe7df4ed68bd
parentaa549ce449a0edccea03b7f4912ee3f9fa9b9b38
runtime: keep objects in free lists marked as allocated.
Restore https://golang.org/cl/41040043 after GC rewrite.
Original description:
On the plus side, we don't need to change the bits on malloc and free.
On the downside, we need to mark objects in the free lists during GC.
But the free lists are small at GC time, so it should be a net win.

benchmark             old ns/op     new ns/op     delta
BenchmarkMalloc8      21.9          20.4          -6.85%
BenchmarkMalloc16     31.1          29.6          -4.82%

LGTM=khr
R=khr
CC=golang-codereviews, rlh, rsc
https://golang.org/cl/122280043
src/pkg/runtime/heapdump.c
src/pkg/runtime/malloc.go
src/pkg/runtime/mgc0.c
src/pkg/runtime/mgc0.h