aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-29 12:25:24 -0400
committerRuss Cox <rsc@golang.org>2014-10-29 12:25:24 -0400
commitd6f4e5020b0dc4014a75782a72d39c99657bd659 (patch)
treee419d4f78cd1af1e45c2dde4fd84ea3dd007b19d /src/runtime/malloc.go
parent8e171e196615bc40a3a804811acf768eee6b2aa8 (diff)
parent599199fd9f53dc91ccc3f29c41cc318052668f70 (diff)
downloadgo-d6f4e5020b0dc4014a75782a72d39c99657bd659.tar.xz
[dev.garbage] all: merge dev.power64 (5ad5e85cfb99) into dev.garbage
The goal here is to get the big-endian fixes so that in some upcoming code movement for write barriers I don't make them unmergeable. LGTM=rlh R=rlh CC=golang-codereviews https://golang.org/cl/166890043
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index c56e038865..020f87a7a6 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)