Skip to content

Commit 2122c36

Browse files
committed
move Fastrandn to logger.go
1 parent 2923c99 commit 2122c36

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

fastcaller_go1.22.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ import (
99
"unsafe"
1010
)
1111

12-
// Fastrandn returns a pseudorandom uint32 in [0,n).
13-
//
14-
//go:noescape
15-
//go:linkname Fastrandn runtime.cheaprandn
16-
func Fastrandn(n uint32) uint32
17-
1812
func pcFileLine(pc uintptr) (file string, line int32) {
1913
funcInfo := findfunc(pc)
2014
if funcInfo._func == nil {

fastcaller_go1.23.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ import (
1111
"unsafe"
1212
)
1313

14-
// Fastrandn returns a pseudorandom uint32 in [0,n).
15-
//
16-
//go:noescape
17-
//go:linkname Fastrandn runtime.cheaprandn
18-
func Fastrandn(n uint32) uint32
19-
2014
func pcFileLine(pc uintptr) (file string, line int) {
2115
f := findfunc(pc)
2216
if f._func == nil {

logger.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,4 +2582,10 @@ func wlprintf(w Writer, level Level, format string, args ...any) (int, error) {
25822582
//go:linkname now time.now
25832583
func now() (sec int64, nsec int32, mono int64)
25842584

2585+
// Fastrandn returns a pseudorandom uint32 in [0,n).
2586+
//
2587+
//go:noescape
2588+
//go:linkname Fastrandn runtime.cheaprandn
2589+
func Fastrandn(n uint32) uint32
2590+
25852591
func b2s(b []byte) string { return *(*string)(unsafe.Pointer(&b)) }

0 commit comments

Comments
 (0)