CK_HT_DESTROY(3)

πŸ’– CK_HT_DESTROY β€” ok bestie, time to say bye to your hash table πŸ’–

So like, this is ck_ht_destroy(3), a page from the Concurrency Kit manual, and she's here to teach you how to immediately destroy a hash table. Yes. Immediately. Not "soon". Not "whenever the scheduler feels like it". Immediately. πŸ’…


✨ LIBRARY ✨

Concurrency Kit, aka libck, and you link her with -lck. That's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

#include <ck_ht.h>

void
ck_ht_destroy(ck_ht_t *ht);

Look at her. Returns void. Takes one pointer. Zero drama. πŸ‘‘


✨ DESCRIPTION ✨

ok so, the ck_ht_destroy() function will request that the underlying allocator β€” like, the one you specified back when you called ck_ht_init(3) β€” immediately destroy the object pointed to by the ht argument. That's it. That's the whole job. She asks the allocator, the allocator does the thing. πŸͺ„

🚨 HOLD ON. READ THIS TWICE, BESTIE. The user must guarantee that no threads are accessing the object pointed to by ht when ck_ht_destroy() is called. No threads. None. Zero. If somebody's still poking at it while you nuke it, that's on you and it is not going to be cute. 😭

✨ RETURN VALUES ✨

ck_ht_destroy() has no return value. Nothing to check, nothing to branch on. She simply does not report back. Silent. Iconic. πŸ¦‹


✨ ERRORS ✨

This function is guaranteed not to fail. Not "probably won't". Not "unlikely to". Guaranteed. The reliability is giving main character energy fr fr. πŸ”₯


✨ SEE ALSO ✨

The whole friend group, in order, exactly as the original rolls them out:

And if you want even more lore, additional information is available at http://concurrencykit.org/ β€” go drink it in, you deserve it. πŸ’œ


ok that's the whole page, you ate that honestly. this was CK_HT_DESTROY(3), dated March 29, 2012, from the Concurrency Kit crew. mwah, go destroy something responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from