116#define SEQ_MASK (SEQ_BR - 1u)
123#define SEQ_MAX_DEPTH 11
177[[nodiscard]] [[gnu::nonnull(1, 2)]]
seq_t
seq_t seq_push(const srn_context_t *ctx, const seq_t *seq, seq_elem_t x)
seq_t seq_empty(const srn_context_t *ctx)
seq_lookup_result_t seq_get(const srn_context_t *ctx, const seq_t *seq, size_t n)
Negative index is not supported.
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β
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