MMgr v2.3.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches

A buffer under read: its bytes, how far the reader went, and whether it ran out. More...

#include <spatium.h>

Data Fields

const uint8_t * buf
size_t len
size_t pos
embed_bool err

Detailed Description

A buffer under read: its bytes, how far the reader went, and whether it ran out.

Note
The read-only counterpart of mmgr_span. buf is const here. A span passed out for a read takes no write through it.
err is sticky, for the same reason overflow is.
Warning
buf points at storage that must outlive every use of the span [BORROWS].

Definition at line 66 of file spatium.h.

Field Documentation

◆ buf

const uint8_t* mmgr_cspan::buf

First byte, or NULL when there is nothing to read [BORROWS].

Definition at line 68 of file spatium.h.

◆ len

size_t mmgr_cspan::len

Readable bytes at buf.

Definition at line 69 of file spatium.h.

◆ pos

size_t mmgr_cspan::pos

Bytes read so far.

Definition at line 70 of file spatium.h.

◆ err

embed_bool mmgr_cspan::err

Set once a read runs past len, and never cleared after.

Definition at line 71 of file spatium.h.


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