mirror of
https://github.com/golang/go
synced 2024-11-02 13:42:29 +00:00
runtime: avoid string allocation in printDebuglog
Either due to a new nowritebarrierrec annotation or a change in escape analysis, printDebuglog can't be called from sighandler anymore. Fix this by avoiding a string allocation that's the primary culprit. Change-Id: Ic84873a453f45852b0443a46597ed3ab8c9443fd Reviewed-on: https://go-review.googlesource.com/c/go/+/410121 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
d7941030c9
commit
73587b71a6
1 changed files with 2 additions and 1 deletions
|
@ -777,7 +777,8 @@ func printDebugLog() {
|
|||
// Logged before runtimeInitTime was set.
|
||||
pnano = 0
|
||||
}
|
||||
print(string(itoaDiv(tmpbuf[:], uint64(pnano), 9)))
|
||||
pnanoBytes := itoaDiv(tmpbuf[:], uint64(pnano), 9)
|
||||
print(slicebytetostringtmp((*byte)(noescape(unsafe.Pointer(&pnanoBytes[0]))), len(pnanoBytes)))
|
||||
print(" P ", p, "] ")
|
||||
|
||||
for i := 0; s.begin < s.end; i++ {
|
||||
|
|
Loading…
Reference in a new issue