CK_HS_GC(3)
π CK_HS_GC(3) β ck_hs_gc π
okay bestie, welcome to the CK_HS_GC(3) page, aka the one where we give our hash set a lil spa day β¨ this lives in the Concurrency Kit library, so you'll be linking with libck, i.e. -lck. yes she's that girl. π
πΈ LIBRARY πΈ
Concurrency Kit β link it with libck, or -lck if you're being fancy at the command line. π
β¨ SYNOPSIS β¨
#include <ck_hs.h>
bool
ck_hs_gc(ck_hs_t *hs, unsigned long cycles, unsigned long seed);
that's it. that's the whole vibe check. she takes three args and gives you back a bool. π«Ά
π§ DESCRIPTION π§
so like, ck_hs_gc(3) is the maintenance function β it does a bunch of upkeep routines on the hash set that hs points at, no cap. what kind of upkeep, you ask? π
- defragmentation of probe sequences with respect to tombstones (yes, tombstones, very gothic of her π), and
- if the delete workload hint has been passed, recalculation of probe sequence bounds.
now let's talk about the args, because they matter fr fr:
cyclesβ tells her how many hash set entries should be subject to attempted maintenance. and listen, ifcyclesis0, then maintenance happens on the complete hash set. the whole thing. every last entry. periodt.seedβ this one decides the start location of the maintenance process. ifcyclesis non-zero, it is recommended thatseedis some random value. like, please randomize her, she deserves it. π²
β οΈ important heads up: if the delete hint has been passed, the function will require an additional 12% of memory (with respect to the existing memory usage of the set) until operation completion. so she's hungry. feed her. π
π¦ RETURN VALUES π¦
when everything goes well, ck_hs_gc(3) returns true π and if it doesn't, it returns false on failure due to memory allocation failure. that's the whole story, bestie. π
π ERRORS π
this function will only return false if there are internal memory allocation failures. that's it. that's the only way she fumbles. π
π SEE ALSO π
the whole friend group, obviously β go read these too:
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_grow(3)ck_hs_rebuild(3)ck_hs_set(3)ck_hs_fas(3)ck_hs_remove(3)ck_hs_count(3)ck_hs_reset(3)ck_hs_reset_size(3)ck_hs_stat(3)
Additional information available at http://concurrencykit.org/ π
and that's a wrap, my love π this page is dated December 17, 2013, and it's page CK_HS_GC(3) β she's been iconic since 2013 and she's still serving. go defrag something. slay. π β¨π¦πΈ
π¦ 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 2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms