gnurl_global_init_mem(3)
β¨ NAME β¨
gnurl_global_init_mem β from the libgnurl Manual β is literally the curl_global_init_mem moment: Global libcurl initialisation with memory callbacks. π
π SYNOPSIS π
#include <gnurl/curl.h>
CURLcode curl_global_init_mem(long flags,
curl_malloc_callback m,
curl_free_callback f,
curl_realloc_callback r,
curl_strdup_callback s,
curl_calloc_callback c );
π§ DESCRIPTION π§
okay so this function works exactly like curl_global_init(3) with one extra little slay: it lets the application set callbacks to replace the internal memory functions that would otherwise be used. π«Ά
If youβre using libcurl from multiple threads, or libcurl was built with the threaded resolver option, then those callback functions must be thread safe. The threaded resolver is a common build option to enable (and in some cases the default), so we strongly urge you to make your callback functions thread safe. no cap.
All callback arguments must be set to valid function pointers. The prototypes for the given callbacks must match these:
void *malloc_callback(size_t size);β to replacemalloc()void free_callback(void *ptr);β to replacefree()void *realloc_callback(void *ptr, size_t size);β to replacerealloc()char *strdup_callback(const char *str);β to replacestrdup()void *calloc_callback(size_t nmemb, size_t size);β to replacecalloc()
This function is otherwise the same as curl_global_init(3), please refer to that man page for documentation. π
β οΈ CAUTION β οΈ
Manipulating these gives considerable powers to the application to severely screw things up for libcurl. Take care! π
π¦ AVAILABILITY π¦
Added in 7.12.0 β¨
π SEE ALSO π
curl_global_init(3), curl_global_cleanup(3)
okay bye bestie β this footer is giving libcurl 7.12.0 and 10 May 2004, page gnurl_global_init_mem(3) πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms