]> Cypherpunks repositories - gostls13.git/commit
runtime: implement xadduintptr and update system mstats using it
authorSrdjan Petrovic <spetrovic@google.com>
Thu, 16 Apr 2015 21:32:18 +0000 (14:32 -0700)
committerDavid Crawshaw <crawshaw@golang.org>
Fri, 24 Apr 2015 16:53:26 +0000 (16:53 +0000)
commit6ad33be2d9d6b24aa741b3007a4bcd52db222c41
tree904764e1cb4fcf37f7bd4022c43eae35d45b6bfb
parent8566979972d51236c37b2823d2c0d52c6efe5406
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>
18 files changed:
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/atomic_386.go
src/runtime/atomic_amd64x.go
src/runtime/atomic_arm.go
src/runtime/atomic_arm64.go
src/runtime/atomic_ppc64x.go
src/runtime/atomic_test.go [new file with mode: 0644]
src/runtime/export_test.go
src/runtime/malloc.go
src/runtime/mem_bsd.go
src/runtime/mem_darwin.go
src/runtime/mem_linux.go
src/runtime/mem_plan9.go
src/runtime/mem_windows.go
src/runtime/mstats.go
src/runtime/os1_darwin.go
src/runtime/os1_linux.go