Language Environment provides
the following types of storage:
- Stack storage is automatically created by Language Environment and is
used for routine linkage and automatic storage. Refer to Stack storage overview for more information.
- Heap storage is dynamically allocated at a routine's
first request for storage that has a lifetime not related to the execution
of the current routine. Refer to Heap storage overview for
more information.
In addition to heap and stack storage, Language Environment® provides
a function that allows AMODE 64 applications to manipulate memory
objects. The __moservices() function allows an application to:
- Create a memory object that will be associated with the current Language Environment enclave.
The user can request certain attributes to be applied to the memory
object, such as the dump priority, and the size of the page frames
to be used when backing it.
- Free a memory object that was created using a previous __moservices()
call
- Specify a shared memory dump priority to be used when allocating
shared memory
For more information about __moservices(), refer to
z/OS XL C/C++ Runtime Library Reference.
Table 1 summarizes the ways in
which Language Environment-conforming
languages use stack and heap storage. The remainder of this section
further discusses stack and heap storage concepts and terminology.
Table 1. Usage of stack
and heap storage by Language Environment-conforming
languagesLanguage |
Stack |
Heap |
---|
C or C++ |
- Automatic variables
- Library routines
|
Variables allocated by: - malloc() function
- __malloc31() function
- __malloc24() function
- calloc() function
- realloc() function
- Static external (RENT)
|