On Tue, Jul 19, 2016 at 03:56:46PM +0200, Kevin Townsend wrote:
> I'm curious what you would have done for a simple FIFO where you are
> likely storing 1 or 2 bytes at a time? If there isn't a good match,
> perhaps it's worth adding a very light weight FIFO or circular buffer
> that can deal with very small records efficiently, but I might be
> missing something that already exists?
Hi Kevin,
You are right - mbufs aren't a very good fit for lots of one- or
two-byte records. There is a circular buffer implementation buried in
the libs/util package that you might find useful. The relevant files
are:
* libs/util/include/util/cbmem.h
* libs/util/src/cbmem.c
A cbmem is initialized with a single flat buffer and can hold variable
sized records.
Chris