diff options
| author | Russ Cox <rsc@golang.org> | 2010-09-30 14:09:19 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-09-30 14:09:19 -0400 |
| commit | 7389ab8d218fe7b7cf2ebdd232524a1ebd5a0b81 (patch) | |
| tree | ce4c2a0e614c104159278ff068f691b88a96ebab /src/pkg/runtime/malloc.goc | |
| parent | f6a217827a4461ece9c81696c40605c7fbb1b267 (diff) | |
| download | go-7389ab8d218fe7b7cf2ebdd232524a1ebd5a0b81.tar.xz | |
runtime: serialize mcache allocation
Fixes racy regex-dna-parallel crashes.
R=r, r2
CC=golang-dev
https://golang.org/cl/2308042
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
| -rw-r--r-- | src/pkg/runtime/malloc.goc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc index fa7164ec57..604290b93b 100644 --- a/src/pkg/runtime/malloc.goc +++ b/src/pkg/runtime/malloc.goc @@ -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; } |
