diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc index fa7164ec57a..604290b93b9 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; }