CK_HT_RESET_SPMC(3)

πŸ’– CK_HT_RESET_SPMC(3) πŸ’–

okay bestie, so this is the ck_ht_reset_spmc page from the Concurrency Kit manual, and it's literally the "nuke everything" button for your hash table 🧹✨


🌸 LIBRARY 🌸

Concurrency Kit, aka libck β€” you link it with -lck. yes that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

#include <ck_ht.h>

bool
ck_ht_reset_spmc(ck_ht_t *ht);

look at her. one include, one function, zero drama. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the ck_ht_reset_spmc() function will remove ALL key-value pairs stored in the hash table pointed to by the ht argument. every single one. gone. not a soft reset, not a lil tidy-up β€” the whole table is getting emptied, and honestly? sometimes that's the self-care we need. πŸ’€βœ¨

it's giving "fresh start, no baggage, main character energy." 🫢


⭐ RETURN VALUES ⭐

if it worked, ck_ht_reset_spmc() returns true and you can go celebrate πŸŽ‰

otherwise it returns false. and ngl, there's exactly one way that happens: a replacement hash table could not be allocated internally. that's it, that's the only fail condition β€” so if you see false, it's an allocation situation, not a "you did something weird" situation. 😭

fr fr, check your allocation path before you blame yourself, bestie.

🌈 SEE ALSO 🌈

the whole friend group, no cap:

more lore available at http://concurrencykit.org/ 🌐


that's the page, periodt. this lil beauty is from the Concurrency Kit source, dated March 29, 2012, and it's filed under CK_HT_RESET_SPMC(3). mwah, go clear a hash table responsibly πŸ’‹πŸ§šπŸ’œ

πŸ“¦ where this page comes from