xa_destroy(9)
π xa_destroy(9) β like, the Kernel API Manual page, bestie
okay so this is xa_destroy(9) from the Kernel API Manual, and it's honestly such a clean little function. no chaos, no drama, just freeing stuff. let's get into it β¨
πΈ NAME πΈ
xa_destroy β free all the internal data structures. like, all of them. every last one. bye bestie π
π SYNOPSIS π
void xa_destroy (struct xarray *xa );
that's it. that's the whole vibe. no return value, it just does the thing.
π¦ ARGUMENTS π¦
xaβ the XArray. that's the one. the XArray in question. π«Ά
β DESCRIPTION β
so here's the tea: after you call this function, the XArray is empty, and it has freed all the memory that was allocated for its internal data structures. clean slate, fresh start, main character energy π
but β and this is the important part, don't skip it β you are responsible for freeing the objects that the XArray references. like, the XArray is not gonna do that for you. it's not your mom. it frees its own internal stuff and dips π
fr fr: the XArray goes empty, its internal memory gets released, but the objects it was pointing at are your problem now. handle them.
π₯ CONTEXT π₯
any context. literally any. it takes and releases the xa_lock, and that's interrupt-safe, so you're good π
π SEE ALSO π
here's the whole friend group π«Ά β all of these live in the kernel file ./lib/xarray.c:
xas_load(9)xas_nomem(9)xas_free_nodes(9)xas_create_range(9)xas_store(9)xas_get_mark(9)xas_set_mark(9)xas_clear_mark(9)xas_init_marks(9)xas_split_alloc(9)xas_split(9)xas_try_split_min_order(9)xas_try_split(9)xas_pause(9)xas_find(9)xas_find_marked(9)xas_find_conflict(9)xa_load(9)__xa_erase(9)xa_erase(9)__xa_store(9)xa_store(9)__xa_cmpxchg(9)__xa_insert(9)xa_store_range(9)xas_get_order(9)xa_get_order(9)__xa_alloc(9)__xa_alloc_cyclic(9)__xa_set_mark(9)__xa_clear_mark(9)xa_get_mark(9)xa_set_mark(9)xa_clear_mark(9)xa_find(9)xa_find_after(9)xa_extract(9)xa_delete_node(9)
and that's the page, bestie π§ source is ./lib, dated October 2026, and it's xa_destroy(9). go free your internal data structures, you iconic legend ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms