summaryrefslogtreecommitdiff
path: root/lib/ringbuf.c
AgeCommit message (Collapse)Author
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-01-03lib: fix a few bugs in ring buffersQuentin Young
* 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>
2018-01-03lib: add ringbuf_copy()Quentin Young
Quick 'n easy way to copy the contents of one ringbuf to another. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-12-26lib: add ringbuf_peek()Quentin Young
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>
2017-12-19lib: add ring bufferQuentin Young
Simple ring buffer implementation useful for fixed size FIFO queues. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>