A buffer under fill: its bytes, how far the writer went, and whether it ran out.
More...
#include <spatium.h>
A buffer under fill: its bytes, how far the writer went, and whether it ran out.
- Note
- Returned by value. This module retains no span of its own.
-
overflow is sticky. Once a write runs past cap it stays set, and only mmgr_spat_reset clears it.
-
To reach it at all is a build failure. So a read of it finds out that something is wrong and does not decide what to do next. It latches so that a wrong program stops its writes and does not walk off the end. It also latches so that one test after a run of appends catches it.
- Warning
- buf points at the caller's storage, which must outlive every use of the span [BORROWS].
Definition at line 50 of file spatium.h.
◆ buf
The buffer the span covers [BORROWS].
Definition at line 52 of file spatium.h.
◆ cap
◆ pos
Bytes written so far, which mmgr_spat_from sets to 0.
Definition at line 54 of file spatium.h.
◆ overflow
| embed_bool mmgr_span::overflow |
Set once a write runs past cap, and only mmgr_spat_reset clears it.
Definition at line 55 of file spatium.h.
The documentation for this struct was generated from the following file: