diff options
| author | Keith Randall <khr@golang.org> | 2013-12-18 17:13:59 -0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2013-12-18 17:13:59 -0800 |
| commit | 2d20c0d6257f5dfc57bb8a78f4e2824803bd6d0e (patch) | |
| tree | 223ddbecf5057fdd17b2a6b61877ee8e47b04c93 /src/pkg/runtime/malloc.h | |
| parent | 7eb45d3c4a0956fc2207001360472ad048e544bc (diff) | |
| download | go-2d20c0d6257f5dfc57bb8a78f4e2824803bd6d0e.tar.xz | |
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
Diffstat (limited to 'src/pkg/runtime/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index 378dcb7338..705b20199d 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -449,7 +449,8 @@ void* runtime·mallocgc(uintptr size, uintptr typ, uint32 flag); void* runtime·persistentalloc(uintptr size, uintptr align, uint64 *stat); int32 runtime·mlookup(void *v, byte **base, uintptr *size, MSpan **s); void runtime·gc(int32 force); -void runtime·markallocated(void *v, uintptr n, bool noptr); +void runtime·markscan(void *v); +void runtime·marknogc(void *v); void runtime·checkallocated(void *v, uintptr n); void runtime·markfreed(void *v, uintptr n); void runtime·checkfreed(void *v, uintptr n); |
