Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1183)

Unified Diff: src/pkg/runtime/mfixalloc.c

Issue 6997052: code review 6997052: runtime: less aggressive per-thread stack segment caching (Closed)
Patch Set: diff -r 019884311591 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/runtime/malloc.goc ('k') | src/pkg/runtime/proc.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/mfixalloc.c
===================================================================
--- a/src/pkg/runtime/mfixalloc.c
+++ b/src/pkg/runtime/mfixalloc.c
@@ -24,6 +24,7 @@
f->nchunk = 0;
f->inuse = 0;
f->sys = 0;
+ f->cached = 0;
}
void*
@@ -32,6 +33,7 @@
void *v;
if(f->list) {
+ f->cached--;
v = f->list;
f->list = *(void**)f->list;
f->inuse += f->size;
@@ -43,7 +45,9 @@
if(f->chunk == nil)
runtime·throw("out of memory (FixAlloc)");
f->nchunk = FixAllocChunk;
+ f->cached += FixAllocChunk / f->size;
}
+ f->cached--;
v = f->chunk;
if(f->first)
f->first(f->arg, v);
@@ -59,5 +63,6 @@
f->inuse -= f->size;
*(void**)p = f->list;
f->list = p;
+ f->cached++;
}
« no previous file with comments | « src/pkg/runtime/malloc.goc ('k') | src/pkg/runtime/proc.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b