CReallocSleepOK

Reallocates memory on a resource tag.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

  #include <netware.h> 
   
  void *CReallocSleepOK (
     void    *addr,
     size_t   size,
     rtag_t   rTag,
     int     *slept );
  

Parameters

addr

(IN) Points to a previously allocated block of memory.

size

(IN) Specifies, in bytes, the size of the memory block.

rTag

(IN) Specifies the resource tag.

slept

(OUT) If a pointer is passed, indicates whether the function had to wait for memory:

  • 0 Didn't wait
  • Nonzero Waited

Return Values

If successful, returns a pointer to the newly allocated memory. Otherwise, returns NULL.

Remarks

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 CReallocSleepOK function. If memory is available, the CReallocSleepOK returns successfully with a pointer to a piece of memory at least as large as the size requested and subtracts this amount from the resource tag originally used to allocate the memory. The function initializes all the memory to binary zeroes.

CReallocSleepOK 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 CReallocSleepOK function.

See Also