TNS/R Native Application Migration Guide
Introduction to Native Mode
TNS/R Native Application Migration Guide—523745-001
1-12
Native Process Environment
Data Spaces
When a process is created, several data segments are allocated for its use. A TNS
process has the following data segments:
•
A user data segment, containing global data (for TAL, COBOL85, and small
memory-model C programs) and the user data stack for TNS procedures
•
An automatic (compiler-generated) extended data segment, containing extended
global data and local data, and optionally a heap (for C and C++ programs)
•
A main RISC stack segment, containing the stack for unprivileged native
procedures
•
A privileged RISC stack segment, containing the stack for privileged native
procedures
•
A process file segment (PFS), used by the operating system
•
Optional program-allocated extended data segments (selectable or flat segments)
A native process has the following data segments:
•
A globals-heap segment, containing program global data and, optionally, a heap
•
A main RISC stack segment, containing the stack for unprivileged native
procedures
•
A privileged RISC stack segment, containing the stack for privileged native
procedures
•
Zero or more SRL data segments, used for optional global data owned by each
shared run-time library (SRL)
•
A process file segment (PFS), used by the operating system
•
Optional program-allocated extended data segments (selectable or flat segments)
The globals-heap segment in native processes is comparable to the user data segment
and the automatic extended data segment in TNS processes.
For native C and C++ programs, the native Common Run-Time Environment (CRE)
automatically manages a heap in the globals-heap segment. The heap is optional for
other programs.
RISC stacks grow downwards (from higher to lower addresses), while TNS stacks
grow upwards.
The main RISC stack and the heap grow automatically as needed, to a maximum size.
The maximum size of each can be specified when a process is created. The default
limit for the main RISC stack is 1 megabyte; the default limit for the heap is 32
megabytes.
For more information on the native processes, see the Guardian Programmer’s Guide.