diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-05-15 11:02:33 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-05-15 11:02:33 +0400 |
| commit | 5a89b35bca720d1ba296f5d7f22376b440486faf (patch) | |
| tree | e98091150689c45c24c079e9cbeb5e52d214c181 /src/pkg/runtime/malloc.h | |
| parent | 3de593d94bd7c9c1e75afcc45f5ca89b629d5e64 (diff) | |
| download | go-5a89b35bca720d1ba296f5d7f22376b440486faf.tar.xz | |
runtime: inline size to class conversion in malloc()
Also change table type from int32[] to int8[] to save space in L1$.
benchmark old ns/op new ns/op delta
BenchmarkMalloc 42 40 -4.68%
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/9199044
Diffstat (limited to 'src/pkg/runtime/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index 52b76d5574..7474f85258 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -275,6 +275,8 @@ int32 runtime·SizeToClass(int32); extern int32 runtime·class_to_size[NumSizeClasses]; extern int32 runtime·class_to_allocnpages[NumSizeClasses]; extern int32 runtime·class_to_transfercount[NumSizeClasses]; +extern int8 runtime·size_to_class8[1024/8 + 1]; +extern int8 runtime·size_to_class128[(MaxSmallSize-1024)/128 + 1]; extern void runtime·InitSizes(void); |
