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
gopacket@v1.1.19
go version go1.21.1 linux/amd64
Fedora 39, amd64
ZeroCopy receiving using pcap on Unix causes 1-allocation per receive, which is very unfortunate:
There is a mysterious comment in this function suggesting some weirdness with GC:
func (p*Handle) pcapNextPacketEx() NextError {
// This horrible magic allows us to pass a ptr-to-ptr to pcap_next_ex// without causing that ptr-to-ptr to itself be allocated on the heap.// Since Handle itself survives through the duration of the pcap_next_ex// call, this should be perfectly safe for GC stuff, etc.returnNextError(C.pcap_next_ex_escaping(p.cptr, C.uintptr_t(uintptr(unsafe.Pointer(&p.pkthdr))), C.uintptr_t(uintptr(unsafe.Pointer(&p.bufptr)))))
}
No idea why this allocates anything.
The text was updated successfully, but these errors were encountered:
ZeroCopy receiving using pcap on Unix causes 1-allocation per receive, which is very unfortunate:
There is a mysterious comment in this function suggesting some weirdness with GC:
No idea why this allocates anything.
The text was updated successfully, but these errors were encountered: