4#ifndef CWIST_HTTP_ASYNC_GC_H
5#define CWIST_HTTP_ASYNC_GC_H
12static inline void cwist_http_async_disown_string(
cwist_sstring *str) {
19 for (; node; node = node->
next) {
20 cwist_http_async_disown_string(node->
key);
21 cwist_http_async_disown_string(node->
value);
28 if (!
map ||
map->arena)
return;
30 for (
size_t i = 0;
i <
map->size; ++
i) {
47 cwist_http_async_disown_string(req->
path);
48 cwist_http_async_disown_string(req->
query);
51 cwist_http_async_disown_string(req->
version);
52 cwist_http_async_disown_string(req->
body);
53 cwist_http_async_disown_map(req->
flash);
56 cwist_http_async_disown_headers(req->
headers);
63 cwist_http_async_disown_string(res->
version);
65 cwist_http_async_disown_string(res->
body);
66 cwist_http_async_disown_headers(res->
headers);
Request-scoped arena allocator backed by libttak arena generations.
bool cwist_arena_owns(const cwist_arena_t *arena, const void *ptr)
Check whether ptr lies inside the active generation buffer.
void cwist_http_async_disown_session(cwist_session_t *session)
Epoch-based garbage collection wrapper.
bool cwist_gc_scope_disown(void *ptr)
Remove ptr from the current thread's pending-sweep list without freeing it, because ownership is bein...
bool cwist_full_gc_enabled(void)
Check whether full-GC mode is currently enabled.
HTTP Protocol Definitions and Helpers.
Signed client-side session cookie API.
struct cwist_session cwist_session_t
Opaque session handle attached to a request.
cwist_query_map * query_params
Parsed query parameters.
char * csrf_token
CSRF token populated by csrf middleware.
cwist_query_map * flash
Flash messages for this request (one-time read).
cwist_sstring * path
e.g., "/users/1"
cwist_sstring * query
e.g., "active=true" (raw)
void * arena
Per-request arena for bump-allocated structs (internal).
void * session
cwist_session_t pointer set by session middleware.
cwist_sstring * version
e.g., "HTTP/1.1"
cwist_query_map * path_params
Parsed path parameters (e.g. :id)
cwist_http_header_node * headers
HTTP Response Object. Supports standard string body or Zero-Copy pointer body.
cwist_sstring * version
e.g., "HTTP/1.1"
cwist_sstring * status_text
e.g., "OK"
const void * ptr_body
Pointer to external data (e.g., mmap region)
char * alt_svc
Alt-Svc header for HTTP/3 upgrade advertisement.
cwist_http_header_node * headers
bool is_ptr_body
Zero-Copy Pointer Body.
cwist_http_body_cleanup_fn ptr_body_cleanup
Optional release hook.
void * arena
Per-response arena for bump-allocated structs (internal).
char * data
Access directly only when raw handling is necessary.
bool borrows_buffer
data is borrowed (static/arena); never freed, detached on mutation