You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Possible Solution
No response
The text was updated successfully, but these errors were encountered:
Verify steps
Description
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.Possible Solution
No response
The text was updated successfully, but these errors were encountered: