gnutls_global_set_mem_functions(3)
β¨ gnutls_global_set_mem_functions(3) β¨
okay bestie, so this one lives in the gnutls manual, and it's literally the function where you tell gnutls which memory functions it should be using. cute concept, slightly cursed execution. let's get into it π
πΈ NAME πΈ
gnutls_global_set_mem_functions β API function
π¦ SYNOPSIS π¦
#include <gnutls/compat.h>
void gnutls_global_set_mem_functions(gnutls_alloc_function alloc_func,
gnutls_alloc_function secure_alloc_func, gnutls_is_secure_function
is_secure_func, gnutls_realloc_function realloc_func,
gnutls_free_function free_func);
π ARGUMENTS π
gnutls_alloc_function alloc_funcβ the default memory allocation function. it's givingmalloc(), honestly. like, that's the vibe it's going for.gnutls_alloc_function secure_alloc_funcβ this is the allocation function that gets used for sensitive data. the delicate stuff. the main character data. πgnutls_is_secure_function is_secure_funcβ a function that returns0if the memory you handed it is not secure. and yeah, it may beNULL. no pressure bestie.gnutls_realloc_function realloc_funcβ a realloc function. that's it. that's the whole description. iconic minimalism β¨gnutls_free_function free_funcβ the function that frees allocated data. and hear me when i say this: it must accept aNULLpointer. non-negotiable, fr fr.
π DEPRECATED π
π¨ okay so this is the part where i hold your hand: since 3.3.0 it is no longer possible to replace the internally used memory allocation functions. so likeβ¦ this whole thing is lowkey a relic. it's giving vintage. it's giving "we keep it around for the lore". π
so here's the tea anyway, for the history girlies π«Ά
this is the function where you set the memory allocation functions that gnutls is going to use. by default, the libc's allocation functions (malloc(), free()) are used by gnutls, and they get used to allocate both sensitive and not sensitive data. so like, everything, all at once, no differentiation. this function exists so you can set those memory allocation functions to something other than the defaults.
β οΈ this function must be called before gnutls_global_init() is called. and no, it is not thread safe. so please, for the love of everything, don't be out here calling it from twelve threads at once. π
π REPORTING BUGS π
found a bug? tell the gnutls people, they want to know!
- report bugs to
<bugs@gnutls.org> - home page:
https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so like, go off, just keep the receipts. π§Ύβ¨
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:
https://www.gnutls.org/manual/
and that's the whole page bestie!! stay hydrated, call gnutls_global_init() after this one, and remember: it's deprecated, so maybe don't build your whole personality around it π
this was gnutls 3.8.13, mwah, slay, bye!! ππ¦β¨
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms