Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (S)
Guardian Procedure Calls Reference Manual—522629-013
14-16
SEGMENT_ALLOCATE_ Procedure
process cannot share a selectable segment with a process that allocated a flat
segment.)
•
Flat segments and increased performance
Although the SEGMENT_USE_ and MOVEX procedures can be used with flat
segments, you can improve performance by eliminating SEGMENT_USE_ calls
and replacing MOVEX calls with direct assignment statements. Programs can
determine the type of segment allocated and take advantage of the flat segment
features whenever a flat segment is allocated.
•
Selectable segments and performance
If you have more than one selectable segment, you might face performance
degradation, because time is wasted when switching between the selectable
segments. This is because only one selectable segment is visible at a time.
Instead, use flat segments, which are always visible.
•
Determining whether a flat segment is allocated
Use the following techniques to determine whether a segment obtained is a flat
segment:
•
Check the value returned in the base-address parameter. If the segment is
a selectable segment, the base address is always %2000000D
(%H00080000); otherwise, the segment is a flat segment. The
base-address parameter of the SEGMENT_USE_ procedure also returns
the base address of a segment.
•
Use the usage-flags parameter of the SEGMENT_GETINFO_ procedure.
In addition, you can use the PROCESSOR_GETINFOLIST_ procedure (memory
management attribute 57) to determine whether flat segments are supported on
the processor. Flat segments are supported on native processors that use D30 or
later versions of the NonStop operating system.
•
Flat segments and user libraries
A user library cannot maintain its own private global variables, so it has no way to
retain the address of a flat segment allocated for its private use. A library can use
a fixed segment ID when allocating a segment and then determine the base
address in subsequent invocations by passing the same segment ID to the
SEGMENT_USE_ procedure. Alternatively, a library can return the base address
to its client and have this address returned as a parameter in each library call.
•
How segment space is divided