aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os1_linux.go
diff options
context:
space:
mode:
authorSrdjan Petrovic <spetrovic@google.com>2015-04-16 14:32:18 -0700
committerDavid Crawshaw <crawshaw@golang.org>2015-04-24 16:53:26 +0000
commit6ad33be2d9d6b24aa741b3007a4bcd52db222c41 (patch)
tree904764e1cb4fcf37f7bd4022c43eae35d45b6bfb /src/runtime/os1_linux.go
parent8566979972d51236c37b2823d2c0d52c6efe5406 (diff)
downloadgo-6ad33be2d9d6b24aa741b3007a4bcd52db222c41.tar.xz
runtime: implement xadduintptr and update system mstats using it
The motivation is that sysAlloc/Free() currently aren't safe to be called without a valid G, because arm's xadd64() uses locks that require a valid G. The solution here was proposed by Dmitry Vyukov: use xadduintptr() instead of xadd64(), until arm can support xadd64 on all of its architectures (not a trivial task for arm). Change-Id: I250252079357ea2e4360e1235958b1c22051498f Reviewed-on: https://go-review.googlesource.com/9002 Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'src/runtime/os1_linux.go')
-rw-r--r--src/runtime/os1_linux.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/runtime/os1_linux.go b/src/runtime/os1_linux.go
index a286dcd960..e4b18c79b3 100644
--- a/src/runtime/os1_linux.go
+++ b/src/runtime/os1_linux.go
@@ -146,8 +146,7 @@ func newosproc(mp *m, stk unsafe.Pointer) {
// Version of newosproc that doesn't require a valid G.
//go:nosplit
func newosproc0(stacksize uintptr, fn unsafe.Pointer) {
- var dummy uint64
- stack := sysAlloc(stacksize, &dummy)
+ stack := sysAlloc(stacksize, &memstats.stacks_sys)
if stack == nil {
write(2, unsafe.Pointer(&failallocatestack[0]), int32(len(failallocatestack)))
exit(1)