Skip to content

Commit

Permalink
chore: reduce func findProcessName mem allocs and copy (#1393)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokeqx authored Jul 19, 2024
1 parent e263518 commit 28794c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions component/process/process_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 28794c6

Please sign in to comment.