CK_HT_STAT(3)

πŸ’– CK_HT_STAT(3) β€” get hash table status πŸ’–

okay bestie, welcome to ck_ht_stat(3), the little gossip sesh where your hash table finally tells you how it's actually doing. this one lives in the Concurrency Kit β€” that's libck, and you link it with -lck, no cap ✨


🌸 SYNOPSIS 🌸

#include <ck_ht.h>

void
ck_ht_stat(ck_ht_t *ht, struct ck_ht_stat *st);

✨ DESCRIPTION ✨

so like. ck_ht_stat(3) rolls up to your hash set and is like "here's the tea" β˜• β€” it stores a bunch of hash set statistics into the object that st points at. that's it. that's the whole job. main character behavior tbh πŸ‘‘

and the ck_ht_stat structure? she's a whole vibe, here's her exact fit:

struct ck_ht_stat {
        uint64_t probe_maximum; /* Longest read-side probe sequence. */
        uint64_t n_entries;     /* Current number of keys in hash set. */
};

so probe_maximum is the longest read-side probe sequence β€” literally how far the worst read had to go hunting πŸ’€ β€” and n_entries is just how many keys are chilling in the hash set right now. iconic duo, fr fr πŸ’…


🫢 RETURN VALUES 🫢

ck_ht_stat(3) has no return value. she gives you nothing back, she just fills in your struct and leaves. not me being unbothered and mysterious 😌


πŸ’€ ERRORS πŸ’€

Behavior is undefined if ht has not been initialized.

like. genuinely. do not. initialize your ht first or it's giving chaos, it's giving ✨unpredictable✨, and not in the cute way 😭 this is a real warning, bestie, not a drill.


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, one big group chat πŸ’¬:

and if you want even more lore, additional information is available at http://concurrencykit.org/ πŸ¦‹ go drink it up, iykyk 🌈


and that's a wrap on CK_HT_STAT(3), babes πŸŽ€ this page is from September 17, 2012 β€” yeah, she's an elder but she ate and left no crumbs β€” courtesy of the Concurrency Kit source. stay initialized out there, bestie πŸ’œβœ¨

πŸ“¦ where this page comes from