CK_HT_HASH_DIRECT(3)
β¨ ck_ht_hash_direct β¨ β the manual page, section 3, bestie edition π
okay so you found yourself staring at ck_ht_hash_direct(3) and you're like "what is this, why is this, who is she" β don't worry, I got you. Sit down, hydrate, let's go π«Ά
πΈ NAME πΈ
ck_ht_hash_direct β generate a hash value for a hash table π
π LIBRARY π
Concurrency Kit, aka libck, which you link with -lck. Iconic library, no notes π
π SYNOPSIS π
#include <ck_ht.h>
void
ck_ht_hash_direct(ck_ht_hash_t *h, ck_ht_t *ht, uintptr_t key);
look at her. three args, zero drama, void return. main character energy fr fr β¨
π¦ DESCRIPTION π¦
So here's the tea β β ck_ht_hash_direct() generates a hash value and stashes it in the object that h points to. That hash value is valid for use in the hash table that ht points to, for the key you passed in. And key here is of direct type, meaning it's the key itself, not a pointer to it. It's giving "no middleman, we go direct" π
That's it. That's the whole function. Lowkey elegant, highkey essential.
π RETURN VALUES π
ck_ht_hash_direct() has no return value. Nothing. Nada. She's a void girlie β the result goes into h and that's where you go get it π
π ERRORS π
okay bestie, this is the part where we get serious for a sec π¨
Behavior is undefined ifkeyis a0orUINTPTR_MAXvalue, or ifhtis uninitialized.
UNDEFINED. Not "an error code", not "a warning", not "she'll be a little grumpy" β undefined behavior. Do not pass 0, do not pass UINTPTR_MAX, do not roll up with an uninitialized ht. It's not the vibe. It will never be the vibe. π
π SEE ALSO π
the whole friend group, in alphabetical-ish order, all of them serving:
ck_ht_stat(3)ck_ht_init(3)ck_ht_destroy(3)ck_ht_hash(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_reset_spmc(3)ck_ht_reset_size_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_entry_key_direct(3)ck_ht_entry_value_direct(3)ck_ht_iterator_init(3)ck_ht_next(3)
and if you want even more lore, additional information is available at http://concurrencykit.org/ π¦
and that's the page!! this one was dated March 29, 2012 and lives as CK_HT_HASH_DIRECT(3) β yeah she's been iconic since 2012 and she's still serving π mwah, go forth and hash responsibly β¨π
π¦ 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