CK_RHS_GROW(3)
π CK_RHS_GROW π
okay bestie, you found the page for ck_rhs_grow, living in the Concurrency Kit (that's libck, link it with -lck π«Ά). It's literally the glow-up button for your hash set's capacity. no cap.
β¨ NAME β¨
ck_rhs_grow β enlarge hash set capacity π
π LIBRARY π
Concurrency Kit (libck, -lck) β she's iconic, she's threaded, she's giving concurrency realness β¨
πΈ SYNOPSIS πΈ
#include <ck_rhs.h>
bool
ck_rhs_grow(ck_rhs_t *hs, unsigned long capacity);
π¦ DESCRIPTION π¦
so the ck_rhs_grow(3) function resizes the hash set so it can hold at least the number of entries you passed in as capacity... at a load factor of one. yes, one. one whole. not a vibe, a number π
the default hash set load factor is 0.5. that's the default, that's the norm, that's just how she lives.
now if you're a planner (main character energy, honestly π) and you wanna minimize the likelihood of memory allocations for a hash set that's meant to store n entries β then specify a capacity of 2n. do the math, queen.
and one more lil thing: the default behavior of ck_rhs is to round capacity up to the next power of two if it's not already a power of two. it's a rounding girly, she simply must. π₯
π« RETURN VALUES π«
- on success?
ck_rhs_grow(3)returnstrue. slay. β - otherwise?
falseon failure. π
π ERRORS π
behavior is undefined if hs is uninitialized. i'm so serious. do not do that. that's not a vibe, that's a crash waiting to happen, periodt.
this function will only return false if there are internal memory allocation failures. that's the only reason. if you see false, blame the allocator, not her. π
π SEE ALSO π
ck_rhs_init(3)ck_rhs_move(3)ck_rhs_destroy(3)CK_RHS_HASH(3)ck_rhs_iterator_init(3)ck_rhs_next(3)ck_rhs_get(3)ck_rhs_put(3)ck_rhs_put_unique(3)ck_rhs_set(3)ck_rhs_fas(3)ck_rhs_remove(3)ck_rhs_rebuild(3)ck_rhs_gc(3)ck_rhs_count(3)ck_rhs_reset(3)ck_rhs_reset_size(3)ck_rhs_stat(3)
additional info available at http://concurrencykit.org/ π
and that's the whole page, bestie β the Concurrency Kit source/version line and that September 17, 2012 date are the lil footer at the very bottom, so consider this your cute sign-off: she's been serving since 2012 and she's still got it. πβ¨π
π¦ 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