CK_RHS_RESET_SIZE(3)

πŸ’– CK_RHS_RESET_SIZE β€” the "wipe the slate but bigger" moment πŸ’–

okay bestie, gather round, because this is a ck_rhs_reset_size(3) page and it's lowkey iconic. it lives in the Concurrency Kit library, aka libck, so you link it with -lck and then you're off to the races. ✨


🌸 SYNOPSIS 🌸

#include <ck_rhs.h>

bool
ck_rhs_reset_size(ck_rhs_t *hs, unsigned long size);

like. look at it. two arguments, one little bool, no drama. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: ck_rhs_reset_size(3) removes all the keys chilling in the hash set that hs points at. all of them. gone. bye. πŸ’…

but wait, it's not just a reset β€” it also creates a new generation of the hash set, and that new generation is preallocated for size entries. so you're not just clearing the vibes, you're setting up the next generation with room for exactly size things. main character planning energy, honestly. πŸ‘‘


⭐ RETURN VALUES ⭐

  • if it slays: returns true πŸ’–
  • if it doesn't: returns false πŸ’€

and ngl, the only reason it fails is if a replacement hash set couldn't be allocated internally. that's it. that's the whole list. no cap. 🫢


πŸ”₯ ERRORS πŸ”₯

okay so this part is serious, bestie, listen up. behavior is undefined if hs is uninitialized. and behavior is also undefined if this function is called by a non-writer thread. undefined behavior is not a vibe. do not do it. πŸ™ˆ

🌈 SEE ALSO 🌈

and if you want even more lore, it's all waiting for you at http://concurrencykit.org/ 🧚


and that's the whole page, periodt. this one was dated May 5, 2013, and it comes to you from the Concurrency Kit girlies β€” CK_RHS_RESET_SIZE(3). go forth and reset responsibly. πŸ’œβœ¨

πŸ“¦ where this page comes from