diff options
| author | Carl Shapiro <cshapiro@google.com> | 2013-04-04 14:18:52 -0700 |
|---|---|---|
| committer | Carl Shapiro <cshapiro@google.com> | 2013-04-04 14:18:52 -0700 |
| commit | c80f5b9bf7c67e1338d04bc0cf21fe285c3a80df (patch) | |
| tree | 296108257e181e3d4a3fab393f721fb1f56a4941 /src/pkg/runtime/malloc.goc | |
| parent | 13d6f8f7f324a5dba5e5c3c1f72d7f09b07846e9 (diff) | |
| download | go-c80f5b9bf7c67e1338d04bc0cf21fe285c3a80df.tar.xz | |
runtime: use a distinct pattern to mark free blocks in need of zeroing
R=golang-dev, dvyukov, khr, cshapiro
CC=golang-dev
https://golang.org/cl/8392043
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
| -rw-r--r-- | src/pkg/runtime/malloc.goc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc index a30129ffc1..f1d25a793f 100644 --- a/src/pkg/runtime/malloc.goc +++ b/src/pkg/runtime/malloc.goc @@ -160,7 +160,7 @@ runtime·free(void *v) if(sizeclass == 0) { // Large object. size = s->npages<<PageShift; - *(uintptr*)(s->start<<PageShift) = 1; // mark as "needs to be zeroed" + *(uintptr*)(s->start<<PageShift) = (uintptr)0xfeedfeedfeedfeedll; // mark as "needs to be zeroed" // 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); @@ -170,7 +170,7 @@ runtime·free(void *v) // Small object. size = runtime·class_to_size[sizeclass]; if(size > sizeof(uintptr)) - ((uintptr*)v)[1] = 1; // mark as "needs to be zeroed" + ((uintptr*)v)[1] = (uintptr)0xfeedfeedfeedfeedll; // mark as "needs to be zeroed" // Must mark v freed before calling MCache_Free: // it might coalesce v and other blocks into a bigger span // and change the bitmap further. |
