/cirbuf

Circular Buffer implementation with mmap(2) *incomplete*

Primary LanguageCBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Circular Buffer implementation with mmap(2)

This is a circular buffer implementation using mmap to ease the logic behind the caller which needs to know if the polled item crosses the maximum size of the underlying array.

Internals

  1. mmap is used to mirror the buffer like the following: cirbuf_mmap

  2. the "mirrored" buffer is then placed beside the buffer. When the user polls the item it doesn't matter if the item crosses the buffer's boundary: cirbuf_mmap_portal