CK_HT_ENTRY_SET_DIRECT(3)

πŸ’– ck_ht_entry_set_direct β€” initialize a key-value pair πŸ’–

okay bestie, welcome to CK_HT_ENTRY_SET_DIRECT(3), the glow-up page where we set up a single entry and make it iconic. no cap, this is one of the little helper functions that makes the whole hash table thing work, and honestly? she's lowkey carrying. πŸŽ€


πŸ“š LIBRARY

Concurrency Kit β€” aka libck, link it with -lck and you're in business πŸ’…


✨ SYNOPSIS ✨

#include <ck_ht.h>

void
ck_ht_entry_set_direct(ck_ht_entry_t *entry, ck_ht_hash_t h,
    uintptr_t key, uintptr_t value);

🌸 DESCRIPTION 🌸

so the way this works: ck_ht_entry_set() (yes, the name in the description is ck_ht_entry_set(), we don't make the rules, we just report them fr fr) will initialize the object that entry points to. and she's getting filled in with three things:

  • the hash value you pass in as h
  • the key value you pass in as key
  • the value you pass in as value

and then boom πŸ’₯ your entry is initialized. main character moment.

This function is typically used to initialize an entry for ck_ht_set_spmc(3) and ck_ht_put_spmc(3) operations. 🫢

heads up: it is expected that the entry will be associated with a hash table initialized with CK_HT_MODE_DIRECT β€” peep ck_ht_init(3) for more info. so like, don't go pairing this entry with the wrong mode, that's not the vibe. πŸ™ˆ

πŸ’« RETURN VALUES πŸ’«

ck_ht_entry_set_direct() has no return value. she gives you nothing back because she's already given you everything. periodt. ✨


πŸ¦‹ ERRORS πŸ¦‹

This function will never fail. literally never. zero drama, zero errors, just pure success energy. she ate and left no crumbs. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

okay here's the whole friend group, go say hi:

Additional information available at http://concurrencykit.org/ 🌈


and that's the page bestie!! this one's from the Concurrency Kit, and the date on the original footer is March 30, 2012 β€” so yeah, she's been serving since 2012 and she's still slaying πŸ’œ mwah, go initialize something cute πŸŽ€πŸ’–

πŸ“¦ where this page comes from