aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.goc
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2012-05-02 18:01:11 +0400
committerDmitriy Vyukov <dvyukov@google.com>2012-05-02 18:01:11 +0400
commitc1c851bbe806d8fb3f483a32e8dfac48522dfe21 (patch)
tree4873e4caab1ecf83da7b7c57eba60d94cc2f567e /src/pkg/runtime/malloc.goc
parent0d55d9832f6b21a5c273073e1703d1d0ae5ecb02 (diff)
downloadgo-c1c851bbe806d8fb3f483a32e8dfac48522dfe21.tar.xz
runtime: avoid unnecessary zeroization of huge memory blocks
+move zeroization out of the heap mutex R=golang-dev, iant, rsc CC=golang-dev https://golang.org/cl/6094050
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
-rw-r--r--src/pkg/runtime/malloc.goc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc
index fbdd6bb021..4bea5e220c 100644
--- a/src/pkg/runtime/malloc.goc
+++ b/src/pkg/runtime/malloc.goc
@@ -60,7 +60,7 @@ runtime·mallocgc(uintptr size, uint32 flag, int32 dogc, int32 zeroed)
npages = size >> PageShift;
if((size & PageMask) != 0)
npages++;
- s = runtime·MHeap_Alloc(&runtime·mheap, npages, 0, 1);
+ s = runtime·MHeap_Alloc(&runtime·mheap, npages, 0, 1, zeroed);
if(s == nil)
runtime·throw("out of memory");
size = npages<<PageShift;