mirror of https://github.com/golang/go.git
runtime/internal/sys: make Len64 nosplit
CL 427615 causes failures when Len64 can't be inlined. It's unclear to me why this wasn't a problem before, but it is used in sensitive contexts and therefore really should be marked. Confirmed that the failures in question reproduce without this change, and don't reproduce with it. Fixes #55117. Change-Id: Ic3aa96af1420cc0c39551908d83f954725c712f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/431058 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
1c19c5602b
commit
cc1b20e8ad
|
|
@ -45,6 +45,10 @@ var ntz8tab = [256]uint8{
|
|||
}
|
||||
|
||||
// len64 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
|
||||
//
|
||||
// nosplit because this is used in src/runtime/histogram.go, which make run in sensitive contexts.
|
||||
//
|
||||
//go:nosplit
|
||||
func Len64(x uint64) (n int) {
|
||||
if x >= 1<<32 {
|
||||
x >>= 32
|
||||
|
|
|
|||
Loading…
Reference in New Issue