mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: fix stack cache typos
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7370050
This commit is contained in:
parent
2b39e418be
commit
16eb2c0b7a
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ struct StackCacheNode
|
||||||
static StackCacheNode *stackcache;
|
static StackCacheNode *stackcache;
|
||||||
static Lock stackcachemu;
|
static Lock stackcachemu;
|
||||||
|
|
||||||
// stackcacherefill/stackcacherelease implement global cache of stack segments.
|
// stackcacherefill/stackcacherelease implement a global cache of stack segments.
|
||||||
// The cache is required to prevent unlimited growth of per-thread caches.
|
// The cache is required to prevent unlimited growth of per-thread caches.
|
||||||
static void
|
static void
|
||||||
stackcacherefill(void)
|
stackcacherefill(void)
|
||||||
|
|
@ -33,7 +33,7 @@ stackcacherefill(void)
|
||||||
if(n == nil) {
|
if(n == nil) {
|
||||||
n = (StackCacheNode*)runtime·SysAlloc(FixedStack*StackCacheBatch);
|
n = (StackCacheNode*)runtime·SysAlloc(FixedStack*StackCacheBatch);
|
||||||
if(n == nil)
|
if(n == nil)
|
||||||
runtime·throw("out of memory (staccachekrefill)");
|
runtime·throw("out of memory (stackcacherefill)");
|
||||||
runtime·xadd64(&mstats.stacks_sys, FixedStack*StackCacheBatch);
|
runtime·xadd64(&mstats.stacks_sys, FixedStack*StackCacheBatch);
|
||||||
for(i = 0; i < StackCacheBatch-1; i++)
|
for(i = 0; i < StackCacheBatch-1; i++)
|
||||||
n->batch[i] = (byte*)n + (i+1)*FixedStack;
|
n->batch[i] = (byte*)n + (i+1)*FixedStack;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue