33 size = (size + 7u) & ~7u;
72 if (!raw)
return NULL;
Memory allocation wrappers backed by libttak.
void cwist_free(void *ptr)
Free memory obtained via cwist_alloc/cwist_strdup/etc.
void * cwist_alloc(size_t size)
Allocate zeroed memory tracked by libttak.
void session_arena_init(struct session_arena *arena, uint8_t *buffer, size_t capacity)
Initialize a linear arena over caller-provided storage.
void session_shared_dec(void *payload)
Drop a reference and destroy the payload when the count reaches zero.
void session_manager_reset(struct session_manager *manager)
Reset all request-scoped allocations owned by the manager.
void * session_shared_alloc(size_t payload_size, void(*destructor)(void *))
Allocate a shared payload with an in-band reference-count header.
void session_arena_reset(struct session_arena *arena)
Rewind the arena so subsequent allocations reuse the full buffer.
void * session_arena_alloc(struct session_arena *arena, size_t size)
Allocate aligned bytes from the request arena.
void session_shared_inc(void *payload)
Increment the reference count for a shared payload.
void session_manager_init(struct session_manager *manager, uint8_t *buffer, size_t capacity)
Initialize the request-scoped allocator state for a session manager.
void session_rc_init(struct session_rc_header *header, void(*destructor)(void *))
Initialize the reference-count metadata for a shared payload.
Linear arena used for fast request-lifetime allocations.
Top-level session allocator state owned by a request context.
Request-scoped arena and shared-payload helpers for session data.