zephyr/lib
Krzysztof Chruscinski 1e46bb3bb5 lib: os: ring_buffer: Allow using full buffer capacity
Previously, ring buffer had capacity of provided buffer size - 1. This
trick was used to distinguish between empty and full states. It had one
drawback: ring buffer could not be used as a pool of equal sized buffers
(using ring_buf_put_claim and ring_buf_get_claim).
Reworked internals to use non wrapping head and tail. Since they are
non wrapping, there is no issue with distinguishing between empty and
full. Since this appraoch would be vulnerable to wrapping on 32 bit
boundary, added a mechanism which periodically reduces all indexes to
avoid 32 bit wrapping.

After this rework, buffer has one byte more capacity. Simple test shows
slight performance improvement.

Updated tests to reflect increased capacity and added test to check if
it is possible to continuesly allocated 2 buffers of half ring buffer
size.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-11-11 13:17:49 +01:00
..
cmsis_rtos_v1 zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
cmsis_rtos_v2 lib: cmsis_rtos_v2: Handle possible zero length array 2020-09-18 10:13:58 -05:00
fnmatch
gui lib: gui: lvgl: update to v7.6.1 2020-11-01 10:51:00 -05:00
libc libc: newlib: fix virtual memory arena size 2020-11-09 20:19:13 -05:00
open-amp
os lib: os: ring_buffer: Allow using full buffer capacity 2020-11-11 13:17:49 +01:00
posix lib: posix: unchecked return value while taking semaphore 2020-10-21 06:26:11 -05:00
CMakeLists.txt updatehub: Move from lib to subsys:mgmt folder 2020-08-03 16:33:06 +02:00
Kconfig updatehub: Move from lib to subsys:mgmt folder 2020-08-03 16:33:06 +02:00