57typedef enum : uint32_t {
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_slab_const_t
Slab sizing limits and the freelist terminator.
@ k_ra8_slab_align_bytes
Required cell-size + buffer alignment.
@ k_ra8_slab_nil
Freelist terminator (no next cell).
@ k_ra8_slab_min_cell_bytes
Smallest cell (holds one index).
ra8_err_t ra8_slab_alloc(ra8_slab_t *slab, void **out_cell)
Allocate one cell from the slab (O(1)).
ra8_err_t ra8_slab_free(ra8_slab_t *slab, void *cell)
Return a previously-allocated cell to the slab (O(1)).
ra8_err_t ra8_slab_init(ra8_slab_t *slab, void *buffer, uint32_t buffer_bytes, uint32_t cell_bytes)
Initialise a slab over a caller-owned buffer.
ra8_err_t ra8_slab_stats(const ra8_slab_t *slab, uint32_t *out_free, uint32_t *out_total)
Report the slab's free / total cell counts.
Caller-owned state for one fixed-cell pool.
uint32_t cell_bytes
Bytes per cell (>= 4, multiple of 4).
uint32_t free_head
Index of the first free cell, or k_ra8_slab_nil.
uint32_t cell_count
Total cells the buffer was divided into.
uint32_t free_count
Cells currently free (observability).
uint8_t * base
First byte of the cell array (caller buffer).