CK_RHS_MOVE(3)
π ck_rhs_move β move one from hash set to another π
okay bestie, welcome to ck_rhs_move(3) β yes that's the section 3 manual, we're in the library pages now, it's giving deep internals and honestly? iconic. π«Ά
This one lives in the Concurrency Kit β that's libck, and you link it with -lck. π
β¨ SYNOPSIS β¨
#include <ck_rhs.h>
bool
ck_rhs_move(ck_rhs_t *destination, ck_rhs_t *source,
ck_rhs_hash_cb_t *hash_cb, ck_rhs_compare_cb_t *compare_cb,
struct ck_malloc *m);
like, four pointers and a callback struct, we been knew π
πΈ DESCRIPTION πΈ
so ck_rhs_move(3) initializes source from destination. yes, that's the direction. read it again, it's not a typo, it's literally the whole point of this function, no cap. β¨
While it's doing that, it also re-wires the callbacks for you:
- the hash function gets set to
hash_cb - the comparison function gets set to
compare_cb - the allocator callbacks get set to
m
β οΈ okay now the serious part, bestie, listen up: further modifications to source will result in undefined behavior. undefined behavior is not a vibe. it is the opposite of a vibe. do not do it. π
Concurrent ck_rhs_get(3) and ck_rhs_fas(3) operations to source are legal β but only until the next write operation to destination. so there's a little window where reads are fine, and then the window closes. respect the window. π¦
π§ what is this actually for tho
This operation moves ownership from one hash set object to another, and re-assigns callback functions to developer-specified values. π
Which means: you get to dynamically configure allocation callbacks. slay.
And it's necessary for use-cases involving executable code which may be unmapped underneath the hash set β like, the code can just vanish out from under it and this is how you cope. main character survival energy fr fr. π
β RETURN VALUES β
trueβ upon successful completion,ck_rhs_move(3)returnstrue. ate. πfalseβ otherwise it returnsfalseto indicate an error. π
that's it. two outcomes. binary. she's simple like that.
π SEE ALSO π
go read these too, they're all in the family, it's a whole friend group:
ck_rhs_init(3)ck_rhs_destroy(3)CK_RHS_HASH(3)ck_rhs_iterator_init(3)ck_rhs_next(3)ck_rhs_put(3)ck_rhs_put_unique(3)ck_rhs_set(3)ck_rhs_fas(3)ck_rhs_remove(3)ck_rhs_grow(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 information available at http://concurrencykit.org/ π
and that's the page!! this one was dated July 18, 2013, and it's page CK_RHS_MOVE(3) in the Concurrency Kit manual β so yeah, she's been serving hash set relocation realness since 2013 and she's still here. 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