1
0
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:
Russ Cox 2010-09-30 14:09:19 -04:00
parent f6a217827a
commit 7389ab8d21

View File

@ -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;
}