ReallocSleepOK

Allocates memory on a resource tag.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

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

Parameters

addr

(IN) Points to the memory location to allocate for use.

size

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

rTag

(IN) Specifies the resource tag.

slept

(OUT) Specifies whether the function had to wait for memory:

  • 0 Didn't wait
  • Nonzero Waited

Return Values

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

Remarks

The NetWare operating system tracks the memory that each NLM uses. To have it track that memory for a particular component of your NLM, you can allocate a resource tag by calling AllocateResourceTag and assign memory to it by calling the Alloc, AllocSleepOK, and ReallocSleepOK functions:

  • If memory is immediately available, the functions return successfully with an address to the memory.

  • If the memory is not immediately available, Alloc fails. The AllocSleepOK and ReallocSleepOK functions wait for the operating system to obtain the memory, if available, before returning.

You must use the Free function to free memory allocated with these functions.

See Also