rhltable_free_and_destroy(9)
π rhltable_free_and_destroy(9) π
okay so bestie, this is a page from the Kernel API Manual and tbh it's a short one but it's iconic β it's literally the cleanup queen of the rhashtable world. no cap, every table deserves a graceful exit β¨
β¨ NAME β¨
rhltable_free_and_destroy β free elements and destroy a hash list table π
like, both jobs. at once. she's efficient.
π¦ SYNOPSIS π¦
void rhltable_free_and_destroy (struct rhltable *hlt , void
(*free_fn)(void *ptr, void *arg) , void *arg );
that's the whole vibe. three args, one void return, zero drama π
πΈ ARGUMENTS πΈ
hltβ the hash list table we're about to destroy π«Ά this is the main character, the one getting taken down.free_fnβ the callback that releases the resources of an element π you hand it a pointer to the contents, and it does the actual freeing. think of it as the designated cleanup bestie.argβ a pointer that gets passed straight through tofree_fnπ whatever you want, it just travels along.
π DESCRIPTION π
ok so real talk: this function frees the elements and destroys the hash list table, periodt π₯
and for the full lore β the actual nitty-gritty of how it behaves β you gotta go read the documentation for rhashtable_free_and_destroy. like, that's the source of truth, this one is just the rhltable flavoured sister π iykyk.
π SEE ALSO π
the whole extended universe, fr fr β go check out the Kernel file ./include/linux/rhashtable.h and these iconic siblings:
struct bucket_table(9)rht_grow_above_75(9)rht_shrink_below_30(9)rht_grow_above_100(9)rht_grow_above_max(9)rht_for_each_from(9)rht_for_each(9)rht_for_each_entry_from(9)rht_for_each_entry(9)rht_for_each_entry_safe(9)rht_for_each_rcu_from(9)rht_for_each_rcu(9)rht_for_each_entry_rcu_from(9)rht_for_each_entry_rcu(9)rhl_for_each_rcu(9)rhl_for_each_entry_rcu(9)rhashtable_lookup(9)rhashtable_lookup_fast(9)rhltable_lookup(9)rhashtable_insert_fast(9)rhltable_insert_key(9)rhltable_insert(9)rhashtable_lookup_insert_fast(9)rhashtable_lookup_get_insert_fast(9)rhashtable_lookup_insert_key(9)rhashtable_lookup_get_insert_key(9)rhashtable_remove_fast(9)rhltable_remove(9)rhashtable_replace_fast(9)rhltable_walk_enter(9)
like, that's a whole friend group π go say hi.
ngl this page is short, but the vibe is immaculate. destroy responsibly, bestie π
and that's a wrap! π this little gem lives in ./include/linux and the version on deck is October 2026 β mwah, stan the kernel docs, they ate π
π§ββοΈ
π¦ 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