For several functions of the Rexx-API it is necessary or possible to dynamically allocate or free memory. Depending on the operating system, compiler and REXX interpreter, the method for these allocations and de- allocations vary. To write system independent code, Object REXX comes with two new API function calls called RexxAllocateMemory() and RexxFreeMemory(). These functions are wrapper for the corresponding compiler or operating system memory functions.
PVOID APIENTRY RexxAllocateMemory( ULONG size );
where:
is the number of bytes of requested memory.
Return Codes
Returns a pointer to the newly allocated block of memory, or NULL if no memory could be allocated.
APIRET APIENTRY RexxFreeMemory( PVOID MemoryBlock );
where:
is a void pointer to the block of memory allocated by the Object REXX interpreter, or allocated by a previous call to RexxAllocateMemory().
Return Codes
RexxFreeMemory() always returns 0.