CK_HT_GC(3)
π CK_HT_GC β bestie edition π
okay so you found the ck_ht_gc page, that's the Concurrency Kit manual (CK_HT_GC(3)) and honestly? it's giving "janitor of the hash table" and I'm obsessed. β¨
πΈ LIBRARY πΈ
Concurrency Kit β link it like libck, -lck π
β¨ SYNOPSIS β¨
#include <ck_ht.h>
bool
ck_ht_gc(ck_ht_t *ht, unsigned long cycles, unsigned long seed);
yes bestie, one function, three args, bool return. we love a clean signature. π
π¦ DESCRIPTION π¦
so ck_ht_gc() is the lil glow-up routine for your hash table β it runs a bunch of maintenance tasks on the table that ht points to. what kind of maintenance, you ask? π
- defragmentation of probe sequences with respect to tombstones π (yes, tombstones, it's giving haunted house but make it data structures)
- and recalculation of probe sequence bounds β but only in the case that the delete workload hint has been passed. no hint, no bounds recalc. periodt.
now let's talk args because the details matter:
cyclesβ tells the function how many hash table entries should be subject to attempted maintenance. and ifcyclesis0, then maintenance is performed on the complete hash table. the whole thing. full send. π₯seedβ determines the start location of the maintenance process. and ifcyclesis non-zero, it is recommended thatseedis some random value. yes, recommended. random seed, bestie, do it. π²
β οΈ heads up, this one's important: if the delete hint has been passed, the function will require an additional 12% of memory (with respect to existing memory usage of the set), until operation completion. twelve percent!! budget for it, queen. π
π RETURN VALUES π
- upon successful completion,
ck_ht_gc(3)returnstrueπ«Ά - otherwise it returns
falseon failure due to memory allocation failure. sad girl hours. π
π ERRORS π
this function will only return false if there are internal memory allocation failures. that's it, that's the whole list. no other drama. π
β SEE ALSO β
the whole friend group, go say hi:
ck_ht_count(3)ck_ht_stat(3)ck_ht_init(3)ck_ht_destroy(3)ck_ht_hash(3)ck_ht_hash_direct(3)ck_ht_set_spmc(3)ck_ht_put_spmc(3)ck_ht_get_spmc(3)ck_ht_grow_spmc(3)ck_ht_remove_spmc(3)ck_ht_reset_size_spmc(3)ck_ht_reset_spmc(3)ck_ht_entry_empty(3)ck_ht_entry_key_set(3)ck_ht_entry_key_set_direct(3)ck_ht_entry_key(3)ck_ht_entry_key_length(3)ck_ht_entry_value(3)ck_ht_entry_set(3)ck_ht_entry_set_direct(3)ck_ht_entry_key_direct(3)ck_ht_entry_value_direct(3)ck_ht_iterator_init(3)ck_ht_next(3)
additional information available at http://concurrencykit.org/ π
and that's the tea, bestie β this page is from the Concurrency Kit (libck), dated December 18, 2013, filed under CK_HT_GC(3). go gc your hash table, you're doing amazing sweetie πβ¨π
π¦ 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