Hi Pablo, Do you think pktb_make() might be a better name for this new function? I noticed an errant free() call after "errno = EPROTONOSUPPORT" so there will have to be a v2 anyway. I could merge the (now almost-) identical second halves of pktb_alloc and pktb_make into a static function to avoid the duplicate code maintenance overhead. Would you prefer that? Cheers ... Duncan. On Tue, Dec 10, 2019 at 10:26:33PM +1100, Duncan Roe wrote: > pktb_usebuf() is a copy of pktb_alloc() with the first part modified to use > a supplied buffer rather than calloc() one. I thought this would give a > measurable performance boost and it does. > All the code after the memset() call is common to pktb_alloc(). If you like, > I can submit a v2 with this code in a static function called by both. > > Duncan Roe (1): > src: Add alternative function to pktb_alloc to avoid malloc / free > overhead > > include/libnetfilter_queue/pktbuff.h | 2 + > src/extra/pktbuff.c | 82 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 84 insertions(+) > > -- > 2.14.5 >