foxhoundsk / cirbuf

Circular Buffer implementation with mmap(2) *incomplete*

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

For more information, please refer to my note at HackMD.

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

About

Circular Buffer implementation with mmap(2) *incomplete*

License:BSD 2-Clause "Simplified" License


Languages

Language:C 95.2%Language:Shell 3.6%Language:Makefile 1.1%