libwget-xalloc(3) | wget2 | libwget-xalloc(3) |
libwget-xalloc
void wget_set_oomfunc (void(*oom_callback)(void))
void * wget_malloc (size_t size)
void * wget_calloc (size_t nmemb, size_t size)
void * wget_realloc (void *ptr, size_t size)
void wget_free (void *ptr)
The provided memory allocation functions are used by explicit libwget memory allocations. They differ from the standard ones in that they exit the program in an out-of-memory situation with EXIT_FAILURE. That means, you don't have to check the returned value against NULL.
You can provide a out-of-memory function that will be called before exit(), e.g. to print out a 'No memory' message.
To work around this behavior, provide your own allocation routines, namely malloc(), calloc(), realloc().
Parameters:
Set a custom out-of-memory function.
Parameters:
Returns:
Like the standard malloc(), except that it doesn't return NULL values. If an out-of-memory condition occurs the oom callback function is called (if set). Thereafter the application is terminated by exit(EXIT_FAILURE);
Parameters:
Returns:
Like the standard calloc(), except that it doesn't return NULL values. If an out-of-memory condition occurs the oom callback function is called (if set). Thereafter the application is terminated by exit(EXIT_FAILURE);
Parameters:
Returns:
Like the standard realloc(), except that it doesn't return NULL values. If an out-of-memory condition occurs or size is 0, the oom callback function is called (if set). Thereafter the application is terminated by exit(EXIT_FAILURE);
Parameters:
This function is like free().
It is basically needed on systems where the library malloc heap is different from the caller's malloc heap, which happens on Windows when the library is a separate DLL.
To prevent typical use-after-free issues, use the macro wget_xfree().
Generated automatically by Doxygen for wget2 from the source code.
Thu May 17 2018 | Version 1.99.1 |