Allocates memory on a resource tag.
#include <netware.h>
void *CAllocSleepOK (
size_t size,
rtag_t rTag
int *slept);
(IN) Specifies, in bytes, the size of the memory block.
(IN) Specifies the resource tag.
(OUT) If a pointer is passed, indicates whether the function had to wait for memory:
If successful, returns a pointer to the newly allocated memory. Otherwise, returns NULL.
The NetWare operating system counts the allocated memory that each NLM uses. To have it count the memory for a particular component of your NLM, allocate a resource tag by calling AllocateResourceTag and then call the CAllocSleepOK function. If memory is available, the CAllocSleepOK returns successfully with a pointer to a piece of memory at least as large as the size requested. The function initializes all the memory to binary zeroes.
CAllocSleepOK might sleep. If you need to know whether it slept, pass a pointer in the slept parameter. If this information is not important to your application, you can pass a NULL pointer for the slept parameter.
You must use the Free function to return memory allocated with the AllocSleepOK function.