When your program no longer needs the memory object, it
uses IARV64 DETACH to free (delete) the memory object. You can free
memory objects that are related to each other through the user token
defined on the IARV64 GETSTOR service. Additionally, all programs
can use the following parameters:
- MATCH=SINGLE,MEMOBJSTART frees a specific memory object, as identified
by its origin address.
- MATCH=USERTOKEN, USERTKN frees a related set of memory objects
by providing the user token specified when the memory objects were
created.
- COND=YES makes the request conditional, but only when you also
pass a user token. IBM® recommends you use COND to avoid
having the program abend because it asked to free a memory object
that doesn't exist.
Three conditions to avoid when you try to free a memory object
are:
If you specify the COND=YES parameter, you must also specify a
user token. In the recovery routine that gets control at an abend,
you can ignore the abend and leave the memory object in an unusable
state.
As part of normal task termination, RTM frees the memory objects
owned by the terminating task.