]> Cypherpunks repositories - gostls13.git/commit
runtime: mark objects in free lists as allocated and unscannable.
authorKeith Randall <khr@golang.org>
Thu, 19 Dec 2013 01:13:59 +0000 (17:13 -0800)
committerKeith Randall <khr@golang.org>
Thu, 19 Dec 2013 01:13:59 +0000 (17:13 -0800)
commit2d20c0d6257f5dfc57bb8a78f4e2824803bd6d0e
tree223ddbecf5057fdd17b2a6b61877ee8e47b04c93
parent7eb45d3c4a0956fc2207001360472ad048e544bc
runtime: mark objects in free lists as allocated and unscannable.

On the plus side, we don't need to change the bits when mallocing
pointerless objects.  On the other hand, 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                    40           33  -17.65%
BenchmarkMalloc16                   45           38  -15.72%
BenchmarkMallocTypeInfo8            58           59   +0.85%
BenchmarkMallocTypeInfo16           63           64   +1.10%

R=golang-dev, rsc, dvyukov
CC=cshapiro, golang-dev
https://golang.org/cl/41040043
src/pkg/runtime/malloc.goc
src/pkg/runtime/malloc.h
src/pkg/runtime/mgc0.c