libwget-xalloc(3)
β¨ libwget-xalloc β¨
okay so bestie, welcome to libwget-xalloc(3) π this one lives in the Library Functions Manual section, and it's literally all about memory allocation functions. yes, malloc-and-friends core. it's giving backstage pass to how wget2 gets its memory π
π¦ NAME π¦
libwget-xalloc β Memory allocation functions π
πΈ SYNOPSIS πΈ
β¨ Variables β¨
like, here's the whole squad of global function pointers, defaults and all π
wget_malloc_function * wget_malloc_fn = malloc
wget_calloc_function * wget_calloc_fn = calloc
wget_realloc_function * wget_realloc_fn = realloc
wget_free_function * wget_free = free
and the exported versions, with their API glow-up β¨
WGETAPI wget_malloc_function * wget_malloc_fn
WGETAPI wget_calloc_function * wget_calloc_fn
WGETAPI wget_realloc_function * wget_realloc_fn
WGETAPI wget_free_function * wget_free
RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT size_t size
#define wget_xfree(a)
the typedefs, aka the ~types~ of the function crew π
typedef void * wget_malloc_function(size_t)β Type ofmalloc()function.typedef void * wget_calloc_function(size_t, size_t)β Type ofcalloc()function.typedef void * wget_realloc_function(void *, size_t)β Type ofrealloc()function.typedef void wget_free_function(void *)β Type offree()function.
and the inline wrappers, with all their attribute drama π
RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE (1)
WGET_GCC_MALLOC static inline void *NULLABLE wget_malloc(size_t
size)
RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE2 (1, 2)
WGET_GCC_MALLOC static inline void *NULLABLE wget_calloc(size_t
nmemb
RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT WGET_GCC_ALLOC_SIZE (2)
static inline void *NULLABLE wget_realloc(void *ptr
π Detailed Description π
okay so the whole vibe here: these are global function pointers to memory allocation functions and to free(). π«Ά
and the fun part? these pointers can be set to custom functions. yes bestie, you get to swap them out. main character energy fr fr π
π Macro Definition Documentation π
π #define wget_xfree( a) π
Value:
do { if (a) { wget_free((void *)(a)); a=NULL; } } while (0)
Memory allocation function pointers β¨ (that's the whole tagline, no cap)
π§ Variable Documentation π§
β RETURNS_NONNULL LIBWGET_WARN_UNUSED_RESULT size_t size β
Initial value:
{
return wget_calloc_fn(nmemb, size)
π« Author π«
Generated automatically by Doxygen for wget2 from the source code. π€β¨ (not me being jealous of an autogenerated author credit, it's giving lowkey iconic)
ngl bestie, the one thing to remember: these are pointers you're allowed to point somewhere else. swap responsibly π
okay that's the whole page, and just so you know where it came from β this one's wget2, Version 2.3.0, and it's page libwget-xalloc(3) of the Library Functions Manual. mwah, go forth and allocate ππ
π¦ where this page comes from
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms