mirror of
https://github.com/golang/go
synced 2024-11-19 06:54:39 -07:00
runtime: serialize mcache allocation
Fixes racy regex-dna-parallel crashes. R=r, r2 CC=golang-dev https://golang.org/cl/2308042
This commit is contained in:
parent
f6a217827a
commit
7389ab8d21
@ -236,9 +236,11 @@ allocmcache(void)
|
||||
{
|
||||
MCache *c;
|
||||
|
||||
lock(&mheap);
|
||||
c = FixAlloc_Alloc(&mheap.cachealloc);
|
||||
mstats.mcache_inuse = mheap.cachealloc.inuse;
|
||||
mstats.mcache_sys = mheap.cachealloc.sys;
|
||||
unlock(&mheap);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user