FREEMAIN Function

#### Search Results

Search

# FREEMAIN Function

The FREEMAIN function is used to free storage from the thread in which the application is running. Note that the storage to be freed must have been acquired by a previous GETMAIN or GETSTOR.

The length and area values must always be double word multiples. For a FREEMAIN request, Com-plete rounds the length value "UP" and sends a return code 12 to the user program if the area address is not aligned.

Note that the length and address values specified should be those returned by a previous GETMAIN or GETSTOR.

> Format

>   The format for using the FREEMAIN function is:

>       FREEMAIN (retcode, length, area)

>   retcode | Required. Specifies a fullword where Com-plete will place the return code upon completion of the operation.
>   length | Required. Specifies a fullword containing the length of the area to be freed.
>   area | Required. Specifies a fullword containing the address of the area to be freed.

> Return Codes

>   The contents of Register 15 should be checked for the following conditions:

>   0 | No errors.
>   8 | The request space was not previously acquired.
>   12 | An invalid request or an invalid FQE was found.

> Abends

>   There are no abends associated with the FREEMAIN function.