mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-18 08:20:53 +00:00
optimize: reduce func findProcessName mem allocs and copy
This commit is contained in:
parent
9e3589d638
commit
07bcfe7880
1 changed files with 2 additions and 2 deletions
|
@ -46,12 +46,12 @@ func findProcessName(network string, ip netip.Addr, port int) (uint32, string, e
|
|||
|
||||
isIPv4 := ip.Is4()
|
||||
|
||||
value, err := syscall.Sysctl(spath)
|
||||
value, err := unix.SysctlRaw(spath)
|
||||
if err != nil {
|
||||
return 0, "", err
|
||||
}
|
||||
|
||||
buf := []byte(value)
|
||||
buf := value
|
||||
itemSize := structSize
|
||||
if network == TCP {
|
||||
// rup8(sizeof(xtcpcb_n))
|
||||
|
|
Loading…
Add table
Reference in a new issue