hash_empty(9)
π NAME π
hash_empty β the lil vibe check that tells you whether your hashtable is literally empty or not β¨
okay so real talk, this is part of the Kernel API Manual and bestie, the page is called hash_empty(9) β that's the whole name, that's the whole job π
πΈ SYNOPSIS πΈ
hash_empty (hashtable );
that's it. that's the whole call. no cap, it's giving minimalism π
π¦ ARGUMENTS π¦
hashtableβ the hashtable you wanna check π«Ά like, the actual one. the one you're wondering about. hand it over and let the macro do its thing.
π§ DESCRIPTION π§
so here's the tea β β this has to be a macro, and there's a genuinely iconic reason why: HASH_BITS will not work on pointers, because it calculates the size during preprocessing. π
like, it's not a choice, it's a whole structural requirement, iykyk. the preprocessor is doing math before the compiler even wakes up, so pointers simply cannot come to the function-call party. not me explaining macros at 2am but here we are π
π₯ SEE ALSO π₯
- the kernel file
./tools/include/linux/hashtable.hβ like, the actual source, go read it bestie π hash_init(9)hash_add(9)hash_hashed(9)hash_del(9)hash_for_each(9)hash_for_each_safe(9)hash_for_each_possible(9)hash_for_each_possible_safe(9)
the whole hashtable friend group honestly, they all ate π
lowkey a whole family of macros and you're over here checking if one of them is empty. valid. iconic. no notes. π
and that's the page!! πβ¨ this lil writeup lives in ./tools/include/linux, dated October 2026, and it goes by hash_empty(9) in case anyone asks β mwah, stay hydrated, go check your hashtables ππ¦πΈ
π¦ 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