30typedef enum : uint32_t {
41 if (arena !=
nullptr) {
76 if ((p ==
nullptr) || (a ==
nullptr)) {
94 if (fresh ==
nullptr) {
97 const size_t copy = (oldsz < newsz) ? oldsz : newsz;
99 (void)
memcpy(fresh, p, copy);
static uint8_t s_arena[k_c6_cam_arena_bytes]
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
void ra8_img_arena_free(void *p)
stb_image STBI_FREE hook: release a block; auto-reset when none live.
void * ra8_img_arena_realloc_sized(void *p, size_t oldsz, size_t newsz)
stb_image STBI_REALLOC_SIZED hook: fresh-allocate, copy, free old.
void ra8_img_arena_bind(ra8_img_arena_t *arena)
Bind arena as the active scratch for subsequent decode allocations.
ra8_img_arena_consts_t
Arena alignment knobs (no magic numbers).
@ k_ra8_img_align_mask
k_ra8_img_align - 1 (round-up mask).
@ k_ra8_img_align
Allocation alignment, bytes.
void * ra8_img_arena_malloc(size_t n)
stb_image STBI_MALLOC hook: bump n bytes from the bound arena.
void ra8_img_arena_unbind(void)
Unbind the active arena; subsequent allocation hooks fail with nullptr.
Heap-free scratch allocator hooks for the stb_image single-TU build.
Caller-owned bump arena backing a single image decode.
size_t offset
Current bump offset.
uint8_t * base
Caller-owned scratch buffer.
size_t cap
Scratch capacity, bytes.
size_t live
Live (allocated, not freed) blocks.