31typedef enum : uint32_t {
42 if (arena !=
nullptr) {
78 if ((size != 0U) && (nmemb > (SIZE_MAX / size))) {
81 const size_t total = nmemb * size;
83 if (block ==
nullptr) {
95 if ((p ==
nullptr) || (a ==
nullptr)) {
static uint8_t s_arena[k_c6_cam_arena_bytes]
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
void ra8_webp_arena_unbind(void)
Unbind the active arena; subsequent allocation hooks fail with nullptr.
void * ra8_webp_arena_calloc(size_t nmemb, size_t size)
libwebp WebPSafeCalloc hook: zeroed nmemb * size bytes.
void ra8_webp_arena_free(void *p)
libwebp WebPSafeFree hook: release a block; auto-reset when none live.
void ra8_webp_arena_bind(ra8_webp_arena_t *arena)
Bind arena as the active scratch for subsequent decode allocations.
ra8_webp_arena_consts_t
Arena alignment knobs (no magic numbers).
@ k_ra8_webp_align
Allocation alignment, bytes.
@ k_ra8_webp_align_mask
k_ra8_webp_align - 1 (round-up mask).
void * ra8_webp_arena_malloc(size_t n)
libwebp WebPSafeMalloc hook: bump n bytes from the bound arena.
Heap-free scratch allocator hooks for the vendored libwebp decoder.
Caller-owned bump arena backing a single WebP decode.
size_t cap
Backing-store capacity in bytes.
uint8_t * base
First byte of caller-owned backing store (>= cap bytes).
uint32_t live
Count of outstanding (unfreed) allocations.
size_t offset
Bump cursor; next allocation starts here.