diff options
| author | Russ Cox <rsc@golang.org> | 2014-11-14 12:10:52 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-11-14 12:10:52 -0500 |
| commit | 3e804631d905162d9e0fc1eba63bce6f95965a24 (patch) | |
| tree | 5a3c5fe864320ef097c2cd8808620d15a1c21913 /src/runtime/malloc.go | |
| parent | 9ad6b7e322deaf72e3c373952249dd078d6bd30e (diff) | |
| parent | 743bdf612a63d631bac88a6b857094152ac33d5c (diff) | |
| download | go-3e804631d905162d9e0fc1eba63bce6f95965a24.tar.xz | |
[dev.cc] all: merge dev.power64 (7667e41f3ced) into dev.cc
This is to reduce the delta between dev.cc and dev.garbage to just garbage collector changes.
These are the files that had merge conflicts and have been edited by hand:
malloc.go
mem_linux.go
mgc.go
os1_linux.go
proc1.go
panic1.go
runtime1.go
LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/174180043
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 89b6ffac3f..20cb6818d2 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -4,9 +4,7 @@ package runtime -import ( - "unsafe" -) +import "unsafe" const ( debugMalloc = false @@ -253,8 +251,10 @@ func mallocgc(size uintptr, typ *_type, flags uint32) 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 { systemstack(func() { unrollgcprog_m(typ) }) |
