diff options
author | Russ Cox <rsc@golang.org> | 2014-10-29 11:45:01 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-10-29 11:45:01 -0400 |
commit | cc517ca5f7183e7f5d91bf75897b23cc0f4ed04f (patch) | |
tree | de12ff4332f39303ab2a6dbfa735071249ea1188 /src/runtime/malloc.go | |
parent | 7d8c40f1a65329094210933bca66b8862b0c28b8 (diff) | |
parent | 05d42f8a61328aa7ea55887f601286b597caf0da (diff) | |
download | go-cc517ca5f7183e7f5d91bf75897b23cc0f4ed04f.tar.gz |
[dev.power64] all: merge default (dd5014ed9b01) into dev.power64
Still passes on amd64.
LGTM=austin
R=austin
CC=golang-codereviews
https://codereview.appspot.com/165110043
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r-- | src/runtime/malloc.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 9b4264f2b..294bc4870 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -4,9 +4,7 @@ package runtime -import ( - "unsafe" -) +import "unsafe" const ( debugMalloc = false @@ -261,8 +259,10 @@ func mallocgc(size uintptr, typ *_type, flags int) unsafe.Pointer { goto marked } ptrmask = (*uint8)(unsafe.Pointer(uintptr(typ.gc[0]))) - // Check whether the program is already unrolled. - if uintptr(atomicloadp(unsafe.Pointer(ptrmask)))&0xff == 0 { + // Check whether the program is already unrolled + // by checking if the unroll flag byte is set + maskword := uintptr(atomicloadp(unsafe.Pointer(ptrmask))) + if *(*uint8)(unsafe.Pointer(&maskword)) == 0 { mp := acquirem() mp.ptrarg[0] = unsafe.Pointer(typ) onM(unrollgcprog_m) |