FREEVIS (Free Virtual Storage) Macro
The macro releases a block of virtual storage that was obtained by the GETVIS macro.
If you code the macro without any operand, the system assumes that the start address of the block to be released is contained in register 1 and that the length of this block was placed into register 0. If the macro is issued without an operand, the macro must not contain a comment unless the comment begins with a comma.
Format 1: Freeing Storage from the Partition FREEVIS Area
Format 2: Freeing Storage from the Space FREEVIS Area
Format 3: Freeing Storage from the System FREEVIS Area
Requirements for the caller
- AMODE:
- 24 or 31
- RMODE:
- 24 or ANY
- ASC Mode:
- Primary
Parameters
- ADDRESS=name1 | (1)
- The start address of the virtual storage block to be released
in the GETVIS area can be specified either in a 4-byte field that
is addressed by
name1
or in a register.The start address is regarded as a 31-bit address.
- LENGTH=name2 | (0)
- The length of the virtual storage block to be released can be
specified in a 4-byte field that is addressed by
name2
or in a register. The length is specified in number of bytes. The smallest unit of virtual storage that can be released by FREEVIS is either of the following:- 128 bytes if the GETVIS area is part of a partition.
- 16 bytes if the GETVIS area is part of the SVA or of the dynamic space GETVIS area.
If the specified length is not a multiple of 128 or 16, it is rounded to the next higher multiple of 128 or 16.
- SPACE=NO | YES
- SPACE=YES indicates that the virtual storage block is to be released
from the dynamic space GETVIS area. The requester needs storage protection
key zero.
SPACE=YES must not be specified together with SVA=YES.
- SPID=name3 | (1)
- Specifies that the whole subpool indicated by the SPID operand
is to be freed. The 8-byte subpool ID (addressed either by
name3
or by a register) consists of the 6-byte subpool name and a 2-byte subpool index that was set by the system when the subpool was created via GETVIS.The address where the SPID operand points to is regarded either as a 24-bit or 31-bit address, depending on the AMODE of the caller.Note: When the SPID operand is specified, the ADDRESS and LENGTH operands are ignored. Use ADDRESS and LENGTH if only a block of storage within the subpool is to be freed. - SVA=NO | YES
- SVA=YES can be specified only in a program that runs with storage
protection key zero.
If you specify SVA=YES, the system releases the block in the SVA. If you specify SVA=NO or omit the operand, the system releases the block in the partition in which your program runs.
SVA=YES must not be specified together with SPACE=YES.
Return Codes in Register 15
- 0
- FREEVIS completed successfully.
- 4
- The size of the (real) partition GETVIS area is 0 K.
- 8
- The specified length is negative.
- 12
- The specified address is not within the GETVIS area or the address
is not a multiple of:
- 128 bytes if the GETVIS area is part of a partition.
- 16 bytes if the GETVIS area is part of the SVA or of the dynamic space GETVIS area.
- 16
- The specified storage block to be released (ADDRESS + LENGTH) exceeds the GETVIS area or is not within a subpool.
- 20
- Invalid FREEVIS option.
- 24
- An invalid subpool ID was passed.
- 28
- The specified subpool does not exist.
- 36
- An invalid subpool index was specified in the SPID operand. The subpool was created with the GETVIS operand SPCNTRL=YES (compare the GETVIS macro).
- 40
- FREEVIS for an area or subpool for which a PFIX request is pending is not allowed.