|Open Object Rexx™: Programming Guide|
|Prev||Chapter 10. Classic Rexx Application Programming Interfaces||Next|
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 API function calls called RexxAllocateMemory() and RexxFreeMemory(). These functions are wrapper for the corresponding compiler or operating system memory functions.
void * REXXENTRY RexxAllocateMemory( size_t size );
is the number of bytes of requested memory.
Returns a pointer to the newly allocated block of memory, or NULL if no memory could be allocated.
RexxReturnCode REXXENTRY RexxFreeMemory( void *MemoryBlock );
is a void pointer to the block of memory allocated by the Object REXX interpreter, or allocated by a previous call to RexxAllocateMemory().
RexxFreeMemory() always returns 0.