116#define SEQ_MASK (SEQ_BR - 1u)
123#define SEQ_MAX_DEPTH 11
186[[nodiscard]] [[gnu::nonnull(1)]]
188[[nodiscard]] [[gnu::nonnull(1)]]
191[[nodiscard]] [[gnu::nonnull(1)]]
Error handling for the runtime.
seq_t seq_empty(const srn_context_t *ctx)
Create an empty seq pinned to ctx.
seq_lookup_result_t seq_get(const seq_t *seq, size_t n)
Negative index is not supported.
seq_t seq_push(const seq_t *seq, seq_elem_t x)
void * seq_elem_t
We use generic pointers to refer to internal nodes, leaf nodes and even elements.
We have two type of node that both are implemented using the same data structure.
seq_elem_t * children
We allocate children to be a buffer of SEQ_BR number of pointers.
size_t len
logical length.
seq_node_t * root
NULL means βall data is in tailβ
const srn_context_t * seq_ctx
The context that owns every allocation the seq retains.
seq_elem_t * tail
small tail array for fast push/pop.
uint8_t depth
tree depth in levels (0 == leaf level)
uint16_t tail_len
0..SEQ_BR