HASHKIT_IS_ALLOCATED(3)
π HASHKIT_IS_ALLOCATED π
okay bestie, welcome to hashkit_is_allocated from the libmemcached-awesome manual, section 3 (that's library functions, iykyk). pull up a chair, grab a boba, we're learning β¨
πΈ NAME πΈ
hashkit_is_allocated β libhashkit Documentation π
β¨ SYNOPSIS β¨
#include <libhashkit-1.0/hashkit.h>
Compile and link with -lhashkit π«Ά
typedef struct hashkit_st hashkit_st
hashkit_st *hashkit_create(hashkit_st *hash)
Parameters
hashβ memory address of ahashkit_ststruct; if anullptris passed, the struct will be dynamically allocated by libhashkit
Returns
- pointer to initialized
hashkit_ststructure
hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
Parameters
destinationβ memory address of ahashkit_ststruct; if anullptris passed, the struct will be dynamically allocated by libhashkitptrβ pointer of thehashkit_ststruct to copy
Returns
- pointer to a
hashkit_ststructure (destination, if notnullptr), initialized fromptr
void hashkit_free(hashkit_st *hash)
Parameters
hashβ pointer to an initializedhashkit_ststruct
bool hashkit_is_allocated(const hashkit_st *hash)
Parameters
hashβ pointer to an initializedhashkit_ststruct
Returns
bool, whether the hash struct was dynamically allocated
π¦ DESCRIPTION π¦
so like, the hashkit_create() function initializes a hashkit object for use. if you pass a nullptr argument for hash, then the memory for the object gets allocated. and if you specify a pre-allocated piece of memory instead? that gets initialized for use. either way, she's ready π
the hashkit_clone() function initializes a hashkit object much like hashkit_create() does, BUT instead of using default settings it will use the settings of the ptr hashkit object. it's giving copy-paste but make it intentional π
the hashkit_free() frees any resources being consumed by the hashkit objects that were initialized with hashkit_create() or hashkit_clone(). let her go, bestie, she's done her job ποΈ
the hashkit_is_allocated() reports whether the memory was allocated for a hashkit object. it's literally just a vibe check on your pointer's origin story π
π RETURN VALUE π
hashkit_create() and hashkit_clone() will return nullptr on failure or pointer to hashkit_st on success. no in-between, no grey area, main character energy only π
hashkit_is_allocated() returns true if the memory for the hashkit object was allocated inside of hashkit_create() or hashkit_clone(), otherwise it is false and was user-supplied memory. slay either way, she's just telling you the truth π«Ά
π SEE ALSO π
libhashkit(3)hashkit_value(3)hashkit_function3)
heads up bestie: that last one is written exactly as it appears in the original β hashkit_function3) β so don't come for me, I'm just the messenger π
and that's the whole page, periodt π this was libmemcached-awesome version 1.1, dated Jul 24, 2025. go forth and free your hashkits responsibly β¨ππ¦
π¦ where this page comes from
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms