CK_HS_MOVE(3)
π ck_hs_move(3) β move one from hash set to another π
okay bestie, gather round, because this little function is lowkey a whole vibe shift for your hash sets π¦
π LIBRARY
Concurrency Kit (that's libck, link it with -lck) π
β¨ SYNOPSIS β¨
#include <ck_hs.h>
bool
ck_hs_move(ck_hs_t *destination, ck_hs_t *source,
ck_hs_hash_cb_t *hash_cb, ck_hs_compare_cb_t *compare_cb,
struct ck_malloc *m);
no cap, that's the whole signature. five args. she's efficient. π
πΈ DESCRIPTION πΈ
so the tea is: ck_hs_move(3) will initialize source from destination. yep, that's the direction, don't come for me, that's literally what the page says. π«Ά
while she's doing that, the hash function gets set to hash_cb, the comparison function gets set to compare_cb, and the allocator callbacks get set to m. it's giving "glow up with a whole new callback wardrobe." β¨
π¨ bestie, listen: further modifications to source will result in undefined behavior. like, don't. it's not a "try it and see" situation, it's a "put the keyboard down" situation. π
but here's the good news β concurrent ck_hs_get(3) and ck_hs_fas(3) operations to source are legal until the next write operation to destination. read-only girlies, you're safe. π
what is this actually doing though? this operation moves ownership from one hash set object to another, and re-assigns callback functions to developer-specified values. slay. that means you get dynamic configuration of allocation callbacks, which is necessary for use-cases involving executable code which may be unmapped underneath the hash set. (imagine your code getting yanked out from under you mid-hash β yeah, that's why this exists. main character problem-solving energy, fr fr. π§)
π RETURN VALUES π
- upon successful completion,
ck_hs_move(3)returnstrueβ ate, no crumbs π - otherwise it returns
falseto indicate an error β not the vibe, but at least she tells you π
π SEE ALSO π
the whole friend group, in order, because they roll together:
ck_hs_init(3)ck_hs_destroy(3)CK_HS_HASH(3)ck_hs_iterator_init(3)ck_hs_next(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_rebuild(3)ck_hs_gc(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/ π
mwah, that's a wrap bestie π this one dropped July 18, 2013 and it lives in the CK_HS_MOVE(3) corner of the manual, brought to you by the Concurrency Kit girlies. periodt. π
β¨
π¦ 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