Miscellaneous utility APIs.
More...
Miscellaneous utility APIs.
◆ rpmMemFailFunc
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
◆ rpmSetMemFail()
Set memory allocation failure callback.
- Parameters
-
func | Allocation failure callback function |
data | User data (or NULL) |
- Returns
- Previous callback function