Guardian Programmer's Guide

Table Of Contents
Managing Memory
Guardian Programmer’s Guide 421922-014
17 - 20
Which Type of Segment Should You Use?
Which Type of Segment Should You Use?
Selectable segments are a carryover from earlier architectures. They will continue to
be supported on newer systems. However, programs written for newer CPUs should
use flat segments for the following reasons:
Flat segments provide a performance advantage. Unlike selectable segments, all
flat segments allocated within a process are accessible to the process at the same
time. You need not make a special call to the SEGMENT_USE_ procedure to
make the flat segment the current segment before accessing it. In addition, you
can move data between flat segments by using assignment statements or move
Figure 17-6. Relative Location of Flat Segments
Flat Segment A
Flat Segment B
Flat Segment C
Main Stack Segment
Globals-Heap
Segment
Used by TNS
processes
and selectable
segments
Address
%h08000000
Address 0
VST147.VSD
Process Private
Space/Non-global
Addresses