From c4cfef075edcbf9391933152ceede9948595d15a Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Wed, 22 May 2013 13:29:17 +0400 Subject: runtime: simplify MCache The nlistmin/size thresholds are copied from tcmalloc, but are unnecesary for Go malloc. We do not do explicit frees into MCache. For sparse cases when we do (mainly hashmap), simpler logic will do. R=rsc, dave, iant CC=gobot, golang-dev, r, remyoudompheng https://golang.org/cl/9373043 --- src/pkg/runtime/malloc.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/pkg/runtime/malloc.h') diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index a4652beda1..cbcc09cdb7 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -109,8 +109,6 @@ enum MaxSmallSize = 32<<10, FixAllocChunk = 128<<10, // Chunk size for FixAlloc - MaxMCacheListLen = 256, // Maximum objects on MCacheList - MaxMCacheSize = 2<<20, // Maximum bytes in one MCache MaxMHeapList = 1<<(20 - PageShift), // Maximum page length for fixed-size list in MHeap. HeapAllocChunk = 1<<20, // Chunk size for heap growth @@ -283,13 +281,11 @@ struct MCacheList { MLink *list; uint32 nlist; - uint32 nlistmin; }; struct MCache { MCacheList list[NumSizeClasses]; - uintptr size; intptr local_cachealloc; // bytes allocated (or freed) from cache since last lock of heap intptr local_objects; // objects allocated (or freed) from cache since last lock of heap intptr local_alloc; // bytes allocated (or freed) since last lock of heap @@ -396,7 +392,7 @@ struct MCentral void runtime·MCentral_Init(MCentral *c, int32 sizeclass); int32 runtime·MCentral_AllocList(MCentral *c, MLink **first); -void runtime·MCentral_FreeList(MCentral *c, int32 n, MLink *first); +void runtime·MCentral_FreeList(MCentral *c, MLink *first); void runtime·MCentral_FreeSpan(MCentral *c, MSpan *s, int32 n, MLink *start, MLink *end); // Main malloc heap. -- cgit v1.3