Skip to content

Repository files navigation

Ring Buffer Cpp

A minimalist C++23 ring buffer.

Features

  • Raw dynamically allocated array to reduce reliance on stl.

Prerequisites

Development Setup

Enter the reproducible development shell (Clang):

nix develop

(If using direnv, simply run direnv allow)

Or pick a toolchain explicitly -- CC/CXX are set by the shell, so the same CMake presets work in both:

nix develop .#clang
nix develop .#gcc

The Nix package builds follow the same scheme (clang is the default):

nix build           # Clang
nix build .#gcc     # GCC

Both toolchains ship clangd, clang-format and clang-tidy; the debugger matches the compiler (lldb for Clang, gdb for GCC).

Building

Configure the project using CMake presets:

cmake --preset default

Build the project (Debug by default):

cmake --build --preset debug

For a release build (optimized, no sanitizers):

cmake --build --preset release

Testing

Run the test suite:

ctest --preset debug

About

A hand-rolled ring buffer built to internalize manual memory management and the Rule of Three; lessons-learned documents the failure modes I hit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages