DFREE Examples
Example 1:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is a simple example that creates a one million byte variable and then releases it.
Example 2:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This example program creates a one million byte variable. It then assigns a second point to the newly acquired space. Execution of the DFREE on the second variable releases the memory and clears the second variable but also clears the first variable. This is done because to the location it references is no longer valid.
Example 3:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
This example creates a test varible. The pointer to the variable is then passed to the LROUTINE where it is received into a second pointer variable. Upon exit from the routine, both pointer variables reference the same memory location. Upon execution of the DFREE instruction, both pointers are cleared and the memory released.
![]() |