ZXFoundation™ 26h2
Loading...
Searching...
No Matches
lib.ring_buffer Module Reference

Data Structures

class  lib::ring_buffer< N >
 A lock-free byte-stream ring buffer (mirrors Linux kfifo). More...

Functions

constexpr auto capacity () const noexcept -> usize
 Returns the total capacity of the buffer.
auto peek (std::span< u8 > buf, usize start_offset=0) const noexcept -> usize
 Peek data without moving the head pointer.
auto pop (std::span< u8 > buf) noexcept -> usize
 Pop data from the ring buffer.
auto push (std::span< const u8 > buf) noexcept -> usize
 Push data into the ring buffer.
auto size () const noexcept -> usize
 Returns the total number of bytes currently in the buffer.

Files

file  lib/ring_buffer.cxxm
 Atomic-based lockless ring buffer (SPSC/MPMC capable).