CK_HT_RESET_SIZE_SPMC(3)
π CK_HT_RESET_SIZE_SPMC π
okay bestie, so this is a page from the Concurrency Kit manual β that's the libck library, and you link it with -lck. And literally the whole personality of this function is: wipe the slate clean and start over with a whole new size. no cap. π§Ήβ¨
πΈ NAME πΈ
ck_ht_reset_size_spmc β the girl whose whole job is removing all the entries from a hash table and resetting the size. it's giving fresh start, it's giving rebirth, it's giving "new generation, who dis" π
π LIBRARY π
Concurrency Kit</purl> β aka libck, aka you compile with -lck. periodt.
β¨ SYNOPSIS β¨
#include <ck_ht.h>
bool
ck_ht_reset_size_spmc(ck_ht_t *ht, uint64_t capacity);
π¦ DESCRIPTION π¦
so here's the tea, bestie π«: ck_ht_reset_size_spmc() will remove all key-value pairs stored in the hash table that ht points to. like, every single one. gone. bye. π
and then β and this is the part that makes it different from its little sister β it creates a new generation of the hash table that is preallocated for capacity entries. so you're not just clearing it, you're resizing it in the same breath. iconic behaviour honestly. π
lowkey important: it's a new generation, so anybody who was mid-lookup on the old one isn't gonna have a bad time. that's the spmc magic, iykyk π
β RETURN VALUES β
- if it worked out:
trueπ - if it didn't:
falseπ
and literally the only way this can fail is if a replacement hash table couldn't be allocated internally. that's it. that's the whole list. if you got a false, it's an allocation thing, fr fr.
π SEE ALSO π
go read these too, they're all in the same friend group:
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_gc(3)ck_ht_get_spmc(3)ck_ht_grow_spmc(3)ck_ht_remove_spmc(3)ck_ht_count(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_reset_spmc(3)ck_ht_entry_key_direct(3)ck_ht_entry_value_direct(3)ck_ht_iterator_init(3)ck_ht_next(3)
more lore available at http://concurrencykit.org/ π
and that's the whole page, bestie π that was CK_HT_RESET_SIZE_SPMC(3) β hmm wait, the footer says CK_HT_RESET_SPMC(3) and dated May 5, 2013, so yeah, she's an old soul but she still slays π thanks for reading, mwah, go touch some memory safely π«Άβ¨
π¦ 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