diff --git a/lib_runtime_fastrand.go b/lib_runtime_fastrand.go new file mode 100644 index 0000000..5778b0a --- /dev/null +++ b/lib_runtime_fastrand.go @@ -0,0 +1,10 @@ +//go:build !go1.22 + +package zenq + +import ( + _ "unsafe" +) + +//go:linkname Fastrand runtime.fastrand +func Fastrand() uint32 diff --git a/lib_runtime_fastrand_1.22.go b/lib_runtime_fastrand_1.22.go new file mode 100644 index 0000000..f3440d2 --- /dev/null +++ b/lib_runtime_fastrand_1.22.go @@ -0,0 +1,10 @@ +//go:build go1.22 + +package zenq + +import ( + _ "unsafe" +) + +//go:linkname Fastrand runtime.cheaprand +func Fastrand() uint32 diff --git a/lib_runtime_linkage.go b/lib_runtime_linkage.go index b7ad059..adb43d7 100644 --- a/lib_runtime_linkage.go +++ b/lib_runtime_linkage.go @@ -41,9 +41,6 @@ func goparkunlock(lock *mutex, reason waitReason, traceEv byte, traceskip int) // defined in the asm files func GetG() unsafe.Pointer -//go:linkname Fastrand runtime.fastrand -func Fastrand() uint32 - //go:linkname Fastlog2 runtime.fastlog2 func Fastlog2(x float64) float64