M$FREE
The M$FREE library routine releases a previously allocated memory region
The memory region is usually allocated with the M$ALLOC library routine. However, programs compiled with -cp option may operate also on a memory regions allocated by external C functions or by a Format 7 SET statement.
Syntax:
 CALL "M$FREE" USING memAddress
Parameters:
memAddress
USAGE HANDLE
Specifies the handle of the memory region to be released.
 
Note - for compatibility reasons this item may also be defined as USAGE POINTER. In this case the program must be compiled either with -ca or -cp options. With -ca POINTER is translated to HANDLE. With -cp POINTER is a real pointer that can be shared with external C routines.
Examples:
Example - Allocate 8 bytes of memory on each of 2 different handles and release that memory after using it in the program.
*> define mem1 and mem2 usage handle
call "m$alloc" using 8, mem1
call "m$alloc" using 8, mem2
...
call "m$free" using mem1
call "m$free" using mem2