sing-box
sing-box copied to clipboard
optimize: reduce func findProcessName mem allocs and copy
syscall.Sysctl
make a slice byte buf and convert to string when return.
func findProcessName
convert string to slice byte again.
This malloc and copy mem twice unnecessarily.
net.inet.tcp.pcblist_n
usually not a small piece of mem, and copy twice would cause mem waste.
Use golang.org/x/sys/unix.SysctlRaw
instead.