rpm 4.19.0
The RPM Package Manager
|
#include <unistd.h>
Go to the source code of this file.
Typedefs | |
typedef void *(* | rpmMemFailFunc) (size_t size, void *data) |
Functions | |
RPM_GNUC_MALLOC | RPM_GNUC_ALLOC_SIZE (1) void *rmalloc(size_t size) |
RPM_GNUC_MALLOC | RPM_GNUC_ALLOC_SIZE2 (1, 2) void *rcalloc(size_t nmemb |
RPM_GNUC_MALLOC | RPM_GNUC_ALLOC_SIZE2 (2, 3) void *rreallocn(void *ptr |
void * | rrealloc (void *ptr, size_t size) |
char * | rstrdup (const char *str) |
char * | rstrndup (const char *str, size_t n) |
void * | rfree (void *ptr) |
rpmMemFailFunc | rpmSetMemFail (rpmMemFailFunc func, void *data) |
Variables | |
RPM_GNUC_MALLOC size_t | size |
RPM_GNUC_MALLOC size_t | nmemb |
Miscellaneous utility macros:
Copied from glib, names replaced to avoid clashing with glib.
typedef void *(* rpmMemFailFunc) (size_t size, void *data) |
Memory allocation failure callback prototype. When registered through rpmSetMemFail(), this gets called if memory allocation through rmalloc() and friends fails. If the application can somehow recover memory here, it can return a newly allocated memory block of requested size, otherwise it must return NULL after performing it's own shutdown deeds or terminate itself.
size | Size of allocation request in bytes |
data | User data (or NULL) |
rpmMemFailFunc rpmSetMemFail | ( | rpmMemFailFunc | func, |
void * | data | ||
) |
Set memory allocation failure callback.
func | Allocation failure callback function |
data | User data (or NULL) |