diff options
| author | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-10-16 20:19:14 +1300 |
|---|---|---|
| committer | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-10-16 09:14:25 +0000 |
| commit | 42c7929c0453b771fd22941ce7c1133c60f58bfb (patch) | |
| tree | 5c1f9ec8fffeee1366aa023abb08044354d35fa5 /src/runtime/debug | |
| parent | 0b8d583320b2f6247669ef0bb1ba011054ca1c88 (diff) | |
| download | go-42c7929c0453b771fd22941ce7c1133c60f58bfb.tar.xz | |
runtime, runtime/debug: access unexported runtime functions with //go:linkname, not assembly stubs
Change-Id: I88f80f5914d6e4c179f3d28aa59fc29b7ef0cc66
Reviewed-on: https://go-review.googlesource.com/15960
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/debug')
| -rw-r--r-- | src/runtime/debug/stubs.go | 8 | ||||
| -rw-r--r-- | src/runtime/debug/stubs.s | 30 |
2 files changed, 3 insertions, 35 deletions
diff --git a/src/runtime/debug/stubs.go b/src/runtime/debug/stubs.go index 95b33e4da6..6c87ffdafe 100644 --- a/src/runtime/debug/stubs.go +++ b/src/runtime/debug/stubs.go @@ -8,12 +8,10 @@ import ( "time" ) -// Uses assembly to call corresponding runtime-internal functions. +// Implemented in package runtime. +func readGCStats(*[]time.Duration) +func freeOSMemory() func setMaxStack(int) int func setGCPercent(int32) int32 func setPanicOnFault(bool) bool func setMaxThreads(int) int - -// Implemented in package runtime. -func readGCStats(*[]time.Duration) -func freeOSMemory() diff --git a/src/runtime/debug/stubs.s b/src/runtime/debug/stubs.s deleted file mode 100644 index 9dc8e54664..0000000000 --- a/src/runtime/debug/stubs.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -#ifdef GOARCH_arm -#define JMP B -#endif -#ifdef GOARCH_arm64 -#define JMP B -#endif -#ifdef GOARCH_ppc64 -#define JMP BR -#endif -#ifdef GOARCH_ppc64le -#define JMP BR -#endif - -TEXT ·setMaxStack(SB),NOSPLIT,$0-0 - JMP runtime·setMaxStack(SB) - -TEXT ·setGCPercent(SB),NOSPLIT,$0-0 - JMP runtime·setGCPercent(SB) - -TEXT ·setPanicOnFault(SB),NOSPLIT,$0-0 - JMP runtime·setPanicOnFault(SB) - -TEXT ·setMaxThreads(SB),NOSPLIT,$0-0 - JMP runtime·setMaxThreads(SB) |
