A buffer being filled: its bytes, how far the writer has gone, and whether it ran out.
More...
#include <spatium.h>
A buffer being filled: its bytes, how far the writer has gone, and whether it ran out.
- Note
- Returned by value. This module keeps no span of its own.
-
overflow is sticky. Once a write has run past cap it stays set, and only mmgr_spat_reset clears it.
-
Reaching it at all is a build failure, and so it is read to find out that something is wrong and not to decide what to do next. It latches so that a wrong program stops writing instead of walking off the end, and 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 46 of file spatium.h.
◆ buf
The buffer the span covers [BORROWS].
Definition at line 48 of file spatium.h.
◆ cap
◆ pos
Bytes written so far, which mmgr_spat_from sets to 0.
Definition at line 50 of file spatium.h.
◆ overflow
| embed_bool mmgr_span::overflow |
Set once a write has run past cap, and cleared only by mmgr_spat_reset.
Definition at line 51 of file spatium.h.
The documentation for this struct was generated from the following file: