summaryrefslogtreecommitdiffstats
path: root/lib/ringbuf.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-1/+1
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* lib: fix a few bugs in ring buffersQuentin Young2018-01-031-4/+4
| | | | | | | | | | | | | * Fix rare failure caused when end pointer is at end of buffer memory and a call to ringbuf_get() is made that reads all of the data in the buffer; start pointer was advanced past end pointer, causing some special handling to be skipped * Fix ringbuf_peek() moving start pointer * Fix use after free * Remove extraneous assignment * Update relevant tests Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add ringbuf_copy()Quentin Young2018-01-031-0/+9
| | | | | | Quick 'n easy way to copy the contents of one ringbuf to another. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add ringbuf_peek()Quentin Young2017-12-271-1/+21
| | | | | | | | | | | Peek functionality for ring buffers and associated tests. Also: * Slight optimization to avoid 0-byte memcpy() by changing > to >= * Add rv checks for some ringbuf_[put|get] calls that were missing them in the test Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add ring bufferQuentin Young2017-12-191-0/+104
Simple ring buffer implementation useful for fixed size FIFO queues. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>