Free Storage Management
Free storage can be allocated by issuing the GETMAIN or DMSFREE macros.
Storage allocated by the GETMAIN macro is taken from the user program area,
beginning after the high address of the user program.
Storage allocated by the DMSFREE macro can be taken from several areas.
If possible, DMSFREE requests are allocated from the low address free storage
area. Otherwise, DMSFREE requests are satisfied from the storage above the user
program area.
There are two types of DMSFREE requests for free storage: requests forUSER storage and NUCLEUS storage. Because these two types of storage are kept in
separate 4K pages, it is possible for storage of one type to be available in low storĀ
age, while no storage of the other type is available.
GETMAIN Free Storage Management
All GETMAIN storage is allocated in the user program area, starting after the end
of the user's actual program. Allocation begins at the location pointed to by theNUCON pointer MAINSTRT. The location MAINHIGH in NUCON is the "high extend" pointer for GETMAIN storage.
The STRINIT function initializes pointers used byCMS for simulation of OS GETMAIN/FREEMAIN storage management. In the usual CMS environment,
that is, when execution is initiated by the LOAD andSTART commands, CMS calls the STRINIT macro as part of the LOAD preparation for execution. In an OS environment established by CMS, such as OSRUN, the STRINIT function has
been performed byCMS and should not be done by the user program. In any case,
the STRINIT macro should be issued only once in theOS environment, preceding
the initial GETMAIN request. The format of the STRINIT macro is:
[label]
where:TYPCALL= [SVC J
BALR.
STRINIT
indicates how control is passed toDMSSTG, the routine that processes the
STRINIT macro.Since DMSSTG is a nucleus-resident routine, other
nucleus-resident routines can branch directly to it (TYPCALL=BALR) while
routines that are not nucleus-resident must use linkageSVC (TYPCALL=SVC). If no operands are specified, the default is TYPECALL=SVC. When the STRINIT macro is executed, both MAINSTRT and MAINHIGH are iniĀ
tialized to the end of the user's program, in the user program area. The end of the
user's program is the upper boundary of the load module created by theCMS LOAD and INCLUDE commands. This upper boundary value is stored in the NUCON field LOCCNT. When execution of the user's program is started and the
Functional Infonnation 323
Free storage can be allocated by issuing the GETMAIN or DMSFREE macros.
Storage allocated by the GETMAIN macro is taken from the user program area,
beginning after the high address of the user program.
Storage allocated by the DMSFREE macro can be taken from several areas.
If possible, DMSFREE requests are allocated from the low address free storage
area. Otherwise, DMSFREE requests are satisfied from the storage above the user
program area.
There are two types of DMSFREE requests for free storage: requests for
separate 4K pages, it is possible for storage of one type to be available in low storĀ
age, while no storage of the other type is available.
GETMAIN Free Storage Management
All GETMAIN storage is allocated in the user program area, starting after the end
of the user's actual program. Allocation begins at the location pointed to by the
The STRINIT function initializes pointers used by
that is, when execution is initiated by the LOAD and
been performed by
the STRINIT macro should be issued only once in the
the initial GETMAIN request. The format of the STRINIT macro is:
[label]
where:
BALR.
STRINIT
indicates how control is passed to
STRINIT macro.
nucleus-resident routines can branch directly to it (TYPCALL=BALR) while
routines that are not nucleus-resident must use linkage
tialized to the end of the user's program, in the user program area. The end of the
user's program is the upper boundary of the load module created by the
Functional Infonnation 323