jwt_memory_grp(3)
π jwt_memory_grp β Memory Handlers π
okay so bestie, this is a page from the LibJWT library manual, section 3 (that's the library-functions girlies, not the shell-command ones). It's literally just the memory-handler corner of LibJWT: the two typedefs and the two functions that let you tell LibJWT how to grab and release memory. Small page, big main-character energy. Let's go. β¨
πΈ SYNOPSIS πΈ
π Typedefs
typedef void *(* jwt_malloc_t) (size_t)β the prototype vibe formalloc(3). πtypedef void(* jwt_free_t) (void *)β the prototype vibe forfree(3). π¦
π Functions
int jwt_set_alloc (jwt_malloc_t pmalloc, jwt_free_t pfree)β set the functions that get used for memory management. πvoid jwt_get_alloc (jwt_malloc_t *pmalloc, jwt_free_t *pfree)
β¨ Detailed Description β¨
These functions allow you to get or set memory allocation functions. That's it, that's the whole thesis. Get them, set them, live your truth. π«Ά
π§ Typedef Documentation π§
π typedef void(* jwt_free_t) (void *)
Prototype for free(3). no cap.
π typedef void *(* jwt_malloc_t) (size_t)
Prototype for malloc(3). fr fr.
π Function Documentation π
β void jwt_get_alloc (jwt_malloc_t * pmalloc, jwt_free_t * pfree)
Get functions used for allocating and freeing memory. Like, hand me the receipts on whatever allocator is currently in the building. π
Parameters
pmallocβ Pointer tomallocfunction output variable, orNULLpfreeβ Pointer tofreefunction output variable, orNULL
β int jwt_set_alloc (jwt_malloc_t pmalloc, jwt_free_t pfree)
Set functions to be used for memory management. By default, LibJWT uses malloc and free for memory management. This function allows the user of the library to specify its own memory management functions. This is especially useful on Windows where mismatches in runtimes across DLLs can cause problems. π (windows DLL runtime mismatch is genuinely the villain of this story, iykyk)
The caller can specify either a valid function pointer for any of the parameters or NULL to use the corresponding default allocator function. so like, mix and match, do your thing. π
Note β This function will also set the memory allocator for the Jansson library. not just LibJWT, bestie. it's giving shared custody. π
Parameters
pmallocβ The function to use for allocating memory orNULLto usemallocpfreeβ The function to use for freeing memory orNULLto usefree
Returns
0 on success or errno otherwise. π
π Author π
Generated automatically by Doxygen for LibJWT from the source code. (yes, a robot wrote the original, and honestly? slay.) π€π
k bye bestie, that's the whole page!! this was LibJWT, Version 3.3.3, manual section jwt_memory_grp(3) β go set your allocators and be free. π
β¨π
π¦ where this page comes from
- ubuntu stonking: libjwt14-doc 3.3.3-1build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms