newtools / ebpf

eBPF Utilities, Maps, and more
MIT License
250 stars 23 forks source link

map: allow lookup and update using unsafe.Pointer #118

Closed lmb closed 5 years ago

lmb commented 5 years ago

By default, Map uses reflection and temporary buffers to translate to / from Go structures. Some performance sensitive users would like to avoid the overhead of this.

Allow passing unsafe.Pointer to map lookup and update functions for such cases. In this case, the caller is responsible for ensuring that the pointed at structure has the correct size, etc.

lmb commented 5 years ago

cc @nplanel