CK_HS_STAT(3)
π CK_HS_STAT(3) π
okay so bestie, this is the ck_hs_stat page from the Concurrency Kit β that's libck, you link it with -lck β and it's genuinely one of the cutest little calls in the whole library. it just... tells you stuff. about your hash set. it's giving β¨receiptsβ¨. let's get into it.
β¨ NAME β¨
ck_hs_stat β get hash set status π
like, the vibe check for your hash set. the numbers. the tea. π«Ά
π LIBRARY π
Concurrency Kit (libck, and you link it with -lck)
π SYNOPSIS π
#include <ck_hs.h>
void
ck_hs_stat(ck_hs_t *hs, struct ck_hs_stat *st);
that's it. that's the whole signature. two pointers, no return, no drama. πΈ
π¦ DESCRIPTION π¦
so ck_hs_stat(3) goes and stores various hash set statistics into the object that st points at. you hand it your hash set (hs) and a stats struct (st) and it fills that struct all the way up. no cap. π₯
the ck_hs_stat structure is defined like this, exactly like this, character for character:
struct ck_hs_stat {
unsigned long tombstones; /* Current number of tombstones in hash set. */
unsigned long n_entries; /* Current number of keys in hash set. */
unsigned int probe_maximum; /* Longest read-side probe sequence. */
};
let's break down the little trio because they each have main character energy:
tombstonesβ anunsigned long, and it's the current number of tombstones in the hash set. yes bestie, tombstones. deleted-but-not-forgotten slots. RIP πͺ¦n_entriesβ anunsigned long, the current number of keys in the hash set. the actual population. the headcount. πprobe_maximumβ anunsigned int, and it's the longest read-side probe sequence. aka the worst-case amount of walking-around somebody had to do to find their stuff. the struggle was real. π
π RETURN VALUES π
ck_hs_stat(3) has no return value. it's a void girlie. it does the thing and it doesn't report back, because the whole point is that the answer is in st. periodt. π
π ERRORS π
listen, this is the part where you actually pay attention:
behavior is undefined if hs is uninitialized. like, undefined undefined. don't do it. π
behavior is undefined if this function is called by a non-writer thread. it's a writer-thread-only situation, bestie. do not pull up with a reader thread. β οΈ
π SEE ALSO π
the whole friend group, go read them all:
ck_hs_init(3)ck_hs_move(3)ck_hs_destroy(3)CK_HS_HASH(3)ck_hs_iterator_init(3)ck_hs_next(3)ck_hs_get(3)ck_hs_put(3)ck_hs_put_unique(3)ck_hs_set(3)ck_hs_fas(3)ck_hs_remove(3)ck_hs_grow(3)ck_hs_gc(3)ck_hs_rebuild(3)ck_hs_count(3)ck_hs_reset(3)ck_hs_reset_size(3)
more info is available at http://concurrencykit.org/ π§
and that's the whole page!! this one's from September 17, 2012 and it's filed under CK_HS_STAT(3) β yeah, 2012, she's an elder but she still ate πβ¨ go get those stats, bestie, iykyk π
π¦ where this page comes from
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian bookworm: libck-dev 0.7.1-10 Β· BSD-2-Clause
- debian trixie: libck-dev 0.7.2-6 Β· BSD-2-Clause
- epel 10: ck-devel 0.7.2-1.el10_1 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- epel 9: ck-devel 0.7.0-10.el9 Β· BSD
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- nixos 26.05: ck 0.7.2
- nixpkgs unstable: ck 0.7.2
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu jammy: libck-dev 0.7.1-6ubuntu2 Β· BSD-2-Clause
- ubuntu noble: libck-dev 0.7.1-13build1 Β· BSD-2-Clause
- ubuntu questing: libck-dev 0.7.2-5ubuntu1
- ubuntu resolute: libck-dev 0.7.2-5ubuntu2 Β· BSD-2-Clause
- ubuntu stonking: libck-dev 0.7.2-11 Β· BSD-2-Clause
- Copyright 2012-2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms