Commit 7389ab8d authored by Russ Cox's avatar Russ Cox

runtime: serialize mcache allocation

Fixes racy regex-dna-parallel crashes.

R=r, r2
CC=golang-dev
https://golang.org/cl/2308042
parent f6a21782
...@@ -236,9 +236,11 @@ allocmcache(void) ...@@ -236,9 +236,11 @@ allocmcache(void)
{ {
MCache *c; MCache *c;
lock(&mheap);
c = FixAlloc_Alloc(&mheap.cachealloc); c = FixAlloc_Alloc(&mheap.cachealloc);
mstats.mcache_inuse = mheap.cachealloc.inuse; mstats.mcache_inuse = mheap.cachealloc.inuse;
mstats.mcache_sys = mheap.cachealloc.sys; mstats.mcache_sys = mheap.cachealloc.sys;
unlock(&mheap);
return c; return c;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment