Guardian Programmer's Guide

Table Of Contents
Managing Memory
Guardian Programmer’s Guide 421922-014
17 - 25
Allocating Extended Data Segments
The size of the segment in bytes. The maximum size of a flat segment is
1120 megabytes in the TNS/R environment and 1536 megabytes in the TNS/E
environment. In case of native mode C / C++ applications, the maximum size of a
flat segment may not be 1120 MB since the address space used for flat segments
is also used for the heap.
The base-address parameter. You can specify this parameter as either an
output parameter or an input parameter. If you specify it as an output parameter,
the base address of the flat segment is determined internally and returned in the
variable you specify. The base address value is different for each allocated
segment. If you specify an address as an input value in the base-address
parameter (not recommended), the segment is allocated using that address as a
base address, if possible.
The options parameter with bit 14 set to 1. This parameter tells the
SEGMENT_ALLOCATE_ procedure to allocate a flat segment. The default setting
of bit 14 is 0, which specifies a selectable segment. If you are specifying the
base-address parameter as an input parameter, you must also set bit 15 to 1.
Note that for compatibility with legacy applications, a selectable segment is the default
allocation on TNS/R systems. If you omit the options parameter, a selectable
segment is allocated.
In most cases, you should specify the base-address parameter as an output
parameter and allow the SEGMENT_ALLOCATE_ procedure to designate the starting
address of the flat segment. In particular, library procedures that allocate flat segments
should not specify a base address, because the allocation might be incompatible with
other segments within the same process.
However, you might want to designate a starting address for a flat segment to ensure
that the same address is used in a backup and primary process pair. The base
address you specify:
Must be within the address range in which flat segments can be allocated. (This
address is subject to change.)
Must not cause the allocated segment to overlap a flat segment that has already
been allocated by the process.
Must be a multiple of 128K bytes.
If you specify the base-address parameter as an input parameter, you must set bit
15 of the options parameter to 1.
If you specify a base address for a flat segment and that address range is not
available, an error is returned.