|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Double-ended arena over one region [base, base+size).
More...
#include <arena.h>
Public Attributes | |
| uint8_t * | base |
| Region start. | |
| size_t | size |
| Region length in bytes. | |
| size_t | persist_end |
| Persistent pool occupies [0, persist_end). | |
| size_t | scratch_top |
| Scratch occupies [scratch_top, size). | |
| size_t | persist_used |
| Bytes currently handed out by the persistent pool (payload). | |
| size_t | persist_hw |
| High-water of persist_end (for sizing). | |
| size_t | scratch_hw |
| High-water of scratch use (size - min scratch_top). | |
Double-ended arena over one region [base, base+size).
persist_end and scratch_top are byte offsets from base; the free middle is [persist_end, scratch_top). The persistent pool owns [0, persist_end) (a chain of first-fit blocks); scratch owns [scratch_top, size) (bump). Initialize with pc_arena_init(); do not touch the fields directly.
| uint8_t* pc_arena::base |
Region start.
Definition at line 58 of file arena.h.
Referenced by pc_arena_init(), pc_arena_owns(), pc_arena_persist_alloc(), pc_arena_persist_free(), pc_arena_scratch_alloc_aligned(), and pc_arena_set_persist_free().
| size_t pc_arena::size |
Region length in bytes.
Definition at line 59 of file arena.h.
Referenced by pc_arena_init(), pc_arena_owns(), pc_arena_scratch_alloc_aligned(), pc_arena_scratch_reset(), pc_arena_scratch_used(), pc_arena_set_add(), pc_arena_set_persist_free(), and pc_secure_reset().
| size_t pc_arena::persist_end |
Persistent pool occupies [0, persist_end).
Definition at line 60 of file arena.h.
Referenced by pc_arena_free_bytes(), pc_arena_init(), pc_arena_persist_alloc(), and pc_arena_persist_free().
| size_t pc_arena::scratch_top |
Scratch occupies [scratch_top, size).
Definition at line 61 of file arena.h.
Referenced by pc_arena_free_bytes(), pc_arena_init(), pc_arena_scratch_alloc_aligned(), pc_arena_scratch_mark(), pc_arena_scratch_release(), pc_arena_scratch_reset(), pc_arena_scratch_used(), and pc_arena_set_scratch_mark().
| size_t pc_arena::persist_used |
Bytes currently handed out by the persistent pool (payload).
Definition at line 62 of file arena.h.
Referenced by pc_arena_init(), pc_arena_persist_alloc(), pc_arena_persist_free(), and pc_arena_persist_used().
| size_t pc_arena::persist_hw |
High-water of persist_end (for sizing).
Definition at line 63 of file arena.h.
Referenced by pc_arena_init(), and pc_arena_persist_alloc().
| size_t pc_arena::scratch_hw |
High-water of scratch use (size - min scratch_top).
Definition at line 64 of file arena.h.
Referenced by pc_arena_init(), pc_arena_scratch_alloc_aligned(), pc_secure_high_water(), and scratch_high_water().