#include <unistd.h>
Go to the source code of this file.
|
typedef void *(* | rpmMemFailFunc )(size_t size, void *data) |
| Memory allocation failure callback prototype. More...
|
|
#define RPM_GNUC_ALLOC_SIZE |
( |
|
x | ) |
|
#define RPM_GNUC_ALLOC_SIZE2 |
( |
|
x, |
|
|
|
y |
|
) |
| |
#define RPM_GNUC_DEPRECATED |
#define RPM_GNUC_EXTENSION |
#define RPM_GNUC_FORMAT |
( |
|
arg_idx | ) |
|
#define RPM_GNUC_INTERNAL |
#define RPM_GNUC_MAY_ALIAS |
#define RPM_GNUC_NO_INSTRUMENT |
#define RPM_GNUC_NONNULL |
( |
|
... | ) |
|
#define RPM_GNUC_NORETURN |
#define RPM_GNUC_NULL_TERMINATED |
#define RPM_GNUC_PRINTF |
( |
|
format_idx, |
|
|
|
arg_idx |
|
) |
| |
#define RPM_GNUC_SCANF |
( |
|
format_idx, |
|
|
|
arg_idx |
|
) |
| |
#define RPM_GNUC_WARN_UNUSED_RESULT |
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.
- Parameters
-
size | Size of allocation request in bytes |
data | User data (or NULL) |
- Returns
- Allocated memory block of requested size or NULL
Definition at line 145 of file rpmutil.h.
void* rcalloc |
( |
size_t |
nmemb, |
|
|
size_t |
size |
|
) |
| |
void* rfree |
( |
void * |
ptr | ) |
|
void* rmalloc |
( |
size_t |
size | ) |
|
Set memory allocation failure callback.
- Parameters
-
func | Allocation failure callback function |
data | User data (or NULL) |
- Returns
- Previous callback function
void* rrealloc |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
char* rstrdup |
( |
const char * |
str | ) |
|