On operating systems where Client-Library uses signal-driven I/O, such as UNIX-based systems, fully asynchronous applications must provide a way for Client-Library to satisfy its interrupt-level memory requirements.
Ordinarily, Client-Library routines satisfy their memory requirements by calling malloc. However, not all implementations of malloc are safely called at the interrupt level. For this reason, fully asynchronous applications are required to provide an alternate way for Client-Library to satisfy its memory requirements.
Client-Library provides two mechanisms by which an asynchronous application satisfies Client-Library’s memory requirements:
The application uses the CS_MEM_POOL property to provide Client-Library with a memory pool.
The application uses the CS_USER_ALLOC and CS_USER_FREE properties to install memory allocation routines that Client-Library safely calls at the interrupt level.
On platforms that use signal-driven I/O, Client-Library’s behavior is undefined if a fully asynchronous application fails to provide a safe way for Client-Library to satisfy memory requirements.
Client-Library attempts to satisfy memory requirements from the following sources in the following order:
Memory pool
User-supplied allocation and free routines
System routines