CK_RHS_REBUILD(3)

✨ CK_RHS_REBUILD(3) ✨

okay bestie, gather round, because this little function is the glow-up your hash set has been begging for πŸ’… it lives in ck_rhs_rebuild and yes it's a real manual page from the Concurrency Kit (that's libck, link it with -lck) so let's get into it πŸŽ€


πŸ¦‹ NAME πŸ¦‹

ck_rhs_rebuild β€” rebuild a hash set. that's it. that's the whole job. iconic behavior fr ✨


🌸 LIBRARY 🌸

Concurrency Kit (aka libck, and you link it with -lck) 🫢


πŸ’– SYNOPSIS πŸ’–

#include <ck_rhs.h>

bool
ck_rhs_rebuild(ck_rhs_t *hs);

look at that signature. clean. minimal. main character energy πŸ‘‘


✨ DESCRIPTION ✨

so like, the ck_rhs_rebuild(3) function will regenerate the hash set that hs is pointing at. lowkey a whole reset-and-refresh moment for your data structure πŸ§–β™€οΈ

and here's the tea: this has the side-effect of pruning degradatory side-effects of workloads that are delete heavy. so if your workload has been doing a lot of deleting, the hash set starts getting a lil crusty, and this is the self-care routine that fixes it. the regenerated hash set should have shorter probe sequences on average, which is the whole point β€” faster lookups, happier you, slay πŸ’…

⚠️ but bestie, listen: this operation will require a significant amount of memory, and it is free to allocate a duplicate hash set in the rebuild process. so like, it might literally build a whole second copy of the set while it works. make sure you've got the room before you go doing all that πŸ’€

🌈 RETURN VALUES 🌈

when it works out, ck_rhs_rebuild(3) returns true πŸŽ‰

and if it doesn't, it returns false 😭 that's the whole deal.


πŸ“ ERRORS πŸ“

good news fr fr: this function will only return false if there are internal memory allocation failures. that's the only L it can take. no other drama πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ

additional information available at http://concurrencykit.org/ β€” go peek, iykyk 🌐


and that's the whole page bestie!! this one's from Concurrency Kit, dated December 7, 2013, and it's filed under CK_RHS_REBUILD(3) πŸ’– go forth and rebuild those hash sets, you've totally got this πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from