aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-05-22 13:29:17 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-05-22 13:29:17 +0400
commitc4cfef075edcbf9391933152ceede9948595d15a (patch)
tree8f577125e1f107ece4abddf3afca80565d405b73 /src/pkg/runtime/malloc.h
parent23dec8d1907f85d487b2adf3f0672c2cc02e4ce6 (diff)
downloadgo-c4cfef075edcbf9391933152ceede9948595d15a.tar.xz
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
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h6
1 files changed, 1 insertions, 5 deletions
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.