aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.goc
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-02-13 11:10:31 -0500
committerRuss Cox <rsc@golang.org>2014-02-13 11:10:31 -0500
commit86e3cb8da5a22794bbbdf34e934dc180e1c86d01 (patch)
treed3a0b21626194ee16c8ec50568040f28c2586566 /src/pkg/runtime/malloc.goc
parentf8e4a2ef94f852c9f112e118f4d266b97839c3c9 (diff)
downloadgo-86e3cb8da5a22794bbbdf34e934dc180e1c86d01.tar.xz
runtime: introduce MSpan.needzero instead of writing to span data
This cleans up the code significantly, and it avoids any possible problems with madvise zeroing out some but not all of the data. Fixes #6400. LGTM=dave R=dvyukov, dave CC=golang-codereviews https://golang.org/cl/57680046
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 db2f9537a9..76ea34e0a2 100644
--- a/src/pkg/runtime/malloc.goc
+++ b/src/pkg/runtime/malloc.goc
@@ -315,7 +315,7 @@ runtime·free(void *v)
c = m->mcache;
if(sizeclass == 0) {
// Large object.
- *(uintptr*)(s->start<<PageShift) = (uintptr)0xfeedfeedfeedfeedll; // mark as "needs to be zeroed"
+ s->needzero = 1;
// Must mark v freed before calling unmarkspan and MHeap_Free:
// they might coalesce v into other spans and change the bitmap further.
runtime·markfreed(v, size);