Alloc

Allocates memory on a resource tag.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

  #include <netware.h> 
   
  void *Alloc (
     size_t   size,
     rtag_t   rTag);
  

Parameters

size

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

rTag

(IN) Specifies the resource tag.

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, you allocate a resource tag by calling AllocateResourceTag and then call the Alloc function.

  • If memory is available, the Alloc function returns successfully with a pointer to a piece of memory at least as large as the requested size.

  • If memory is not immediately available, Alloc returns unsuccessful; it does not sleep.

You must use the Free function to return memory allocated with the Alloc function.

See Also