From 5a89b35bca720d1ba296f5d7f22376b440486faf Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Wed, 15 May 2013 11:02:33 +0400 Subject: 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 --- src/pkg/runtime/malloc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pkg/runtime/malloc.h') 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); -- cgit v1.3-5-g9baa