MMgr v1.0.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches
mmgr_ring_span Struct Reference

Single-producer, single-consumer byte ring, a segment view over it, and loculus keepouts. More...

#include <confinium_exclusivum_infinitas.h>

Data Fields

uint8_t * buf
size_t cap
size_t pos
size_t bytes
size_t read_offset

Detailed Description

Single-producer, single-consumer byte ring, a segment view over it, and loculus keepouts.

A byte region a pinned loculus keeps out: the storage, its extent, and how far a reader has gone.

Note
Nothing of the implementation is written here: mmgr_ring is a run of opaque bytes, and the state laid into it is declared nowhere a consumer can reach.
The caller declares the ring and supplies the bytes; every index, mask and span is the ring's.
Exactly one producer advances head and exactly one consumer advances tail, and so ordering is all that is needed and no entry takes a lock or a read-modify-write on those two.
Nothing is ever zeroed: a loculus keeps its bytes after a drop, which lets a restream run again.

A byte region a pinned loculus keeps out: the storage, its extent, and how far a reader has gone.

Note
Carried here and not taken from spatium, and so this module reaches nothing outside config.
Carried here and not taken from spatium, and so this module reaches nothing outside config.

Definition at line 23 of file confinium_exclusivum_infinitas.h.

Field Documentation

◆ buf

uint8_t * mmgr_ring_span::buf

First byte of the region [BORROWS].

Definition at line 25 of file confinium_exclusivum_infinitas.h.

◆ cap

size_t mmgr_ring_span::cap

Bytes at buf.

Definition at line 26 of file confinium_exclusivum_infinitas.h.

◆ pos

size_t mmgr_ring_span::pos

How far a reader has walked it.

Definition at line 27 of file confinium_exclusivum_infinitas.h.

◆ bytes

size_t mmgr_ring_span::bytes

Bytes at buf.

Definition at line 37 of file memoria_anularis.h.

◆ read_offset

size_t mmgr_ring_span::read_offset

How far a reader has walked it, counted in bytes from buf.

Definition at line 38 of file memoria_anularis.h.


The documentation for this struct was generated from the following files: