Skip to content

Commit 07ad840

Browse files
committed
runtime: remove unneeded noinline directives
Now that mid-stack inlining reports backtraces correctly, we no longer need to protect against inlining in a few critical areas. Update #19348 Update #28640 Update #34276 Change-Id: Ie68487e6482c3a9509ecf7ecbbd40fe43cee8381 Reviewed-on: https://go-review.googlesource.com/c/go/+/195818 Reviewed-by: David Chase <[email protected]>
1 parent 38543c2 commit 07ad840

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

src/runtime/extern.go

-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ func Caller(skip int) (pc uintptr, file string, line int, ok bool) {
200200
// directly is discouraged, as is using FuncForPC on any of the
201201
// returned PCs, since these cannot account for inlining or return
202202
// program counter adjustment.
203-
//go:noinline
204203
func Callers(skip int, pc []uintptr) int {
205204
// runtime.callers uses pc.array==nil as a signal
206205
// to print a stack trace. Pick off 0-length pc here

src/runtime/stack_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,6 @@ func (s structWithMethod) callers() []uintptr {
599599
return pc[:Callers(0, pc)]
600600
}
601601

602-
// The noinline prevents this function from being inlined
603-
// into a wrapper. TODO: remove this when issue 28640 is fixed.
604-
//go:noinline
605602
func (s structWithMethod) stack() string {
606603
buf := make([]byte, 4<<10)
607604
return string(buf[:Stack(buf, false)])

0 commit comments

Comments
 (0)