zephyr/doc/reference
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
..
audio doc: api: sort the API overview alphabetically 2020-10-30 15:57:30 +01:00
bluetooth Bluetooth: Mesh: Encapsulate feature config 2020-11-09 11:23:34 +02:00
crypto doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
devicetree doc: reference: add devicetree bindings content 2020-11-02 14:26:33 -05:00
display doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
drivers device: deprecate DEVICE_INIT 2020-11-10 08:38:09 -06:00
file_system fs: allow external file system implementations 2020-09-03 21:49:34 +02:00
kernel lib: os: ring_buffer: Allow using full buffer capacity 2020-11-11 13:17:49 +01:00
logging doc: update function references to use :c:func: 2020-08-31 09:57:33 -04:00
misc doc: update struct references to use :c:struct: 2020-08-31 09:57:33 -04:00
networking net: shell: Add network mgmt events monitor support 2020-10-13 13:42:50 +03:00
peripherals doc: introduce the regulator driver API 2020-10-28 15:22:53 +01:00
power_management doc: Apply constant qualifier on device instance where relevant 2020-09-02 13:48:13 +02:00
random doc: reference: Clean up and restructure a bit 2020-03-18 11:47:24 +01:00
resource_management sys: onoff: support clients using synchronous transitions 2020-08-14 17:53:39 +02:00
settings doc: provide guidance on recommended settings back end 2020-08-25 09:35:40 +02:00
shell shell: documentation update 2020-10-08 10:12:25 -04:00
storage doc/reference: Added clarification on flash offset relation 2020-10-27 12:52:07 +01:00
usb USB: Add driver and PID for Bluetooth H4 2020-04-20 21:59:47 +03:00
usermode doc: usermode: stack access policy change 2020-10-21 10:20:23 -07:00
util api: promote sys/util.h to experimental 2020-06-18 19:38:10 +02:00
index.rst api: promote sys/util.h to experimental 2020-06-18 19:38:10 +02:00
overview.rst doc: api: sort the API overview alphabetically 2020-10-30 15:57:30 +01:00
terminology.rst device: deprecate DEVICE_INIT 2020-11-10 08:38:09 -06:00