rpm 5.99.90
The RPM Package Manager
 
Loading...
Searching...
No Matches
Miscellaneous utility APIs

Miscellaneous utility APIs. More...

Collaboration diagram for Miscellaneous utility APIs:

Typedefs

typedef void *(* rpmMemFailFunc) (size_t size, void *data)
 

Functions

rpmMemFailFunc rpmSetMemFail (rpmMemFailFunc func, void *data)
 

Detailed Description

Miscellaneous utility APIs.

Typedef Documentation

◆ 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
sizeSize of allocation request in bytes
dataUser data (or NULL)
Returns
Allocated memory block of requested size or NULL

Function Documentation

◆ rpmSetMemFail()

rpmMemFailFunc rpmSetMemFail ( rpmMemFailFunc func,
void * data )

Set memory allocation failure callback.

Parameters
funcAllocation failure callback function
dataUser data (or NULL)
Returns
Previous callback function