mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-06 21:37:38 +03:00
25 lines
388 B
Go
25 lines
388 B
Go
//go:build !disable_unsafe
|
|
|
|
package buf
|
|
|
|
import (
|
|
"os"
|
|
_ "unsafe"
|
|
)
|
|
|
|
//go:linkname parsedebugvars runtime.parsedebugvars
|
|
func parsedebugvars()
|
|
|
|
func init() {
|
|
disableInvalidPtrCheck()
|
|
}
|
|
|
|
func disableInvalidPtrCheck() {
|
|
debug := os.Getenv("GODEBUG")
|
|
if debug == "" {
|
|
os.Setenv("GODEBUG", "invalidptr=0")
|
|
} else {
|
|
os.Setenv("GODEBUG", debug+",invalidptr=0")
|
|
}
|
|
parsedebugvars()
|
|
}
|