Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual—522629-013
2-27
ALLOCATESEGMENT Procedure
(Superseded by SEGMENT_ALLOCATE_
Callers of ALLOCATESEGMENT can share segments with callers of
SEGMENT_ALLOCATE_. High-PIN callers can share segments with low-PIN
callers.
•
Sharing flat segments
A process cannot share a flat segment with a process that allocated a selectable
segment, because the segments reside in different parts of memory. (Similarly, a
process cannot share a selectable segment with a process that allocated a flat
segment.)
For shared flat segments, the call to ALLOCATESEGMENT can be followed by a
call to USESEGMENT, but calling USESEGMENT is unnecessary because all of
the flat segments allocated by a process are always accessible to the process.
For more information on flat segments, see the SEGMENT_ALLOCATE_
procedure.
Examples
STATUS := ALLOCATESEGMENT (SEGMENT^ID, SEG^SIZE, SWAP^FILE);
! standard call to create a user segment;
! "swap^file" parameter can be omitted
STATUS := ALLOCATESEGMENT (SEGMENT^ID, , FILENAME, %60000);
! allocates a read-only segment whose
! segment size is taken from the size of the
! swap file
STATUS := ALLOCATESEGMENT (SEGMENT^ID, SEGMENT^SIZE,
FILENAME, %44000);
! allocates an extensible segment whose swap file
! disk extents will be allocated as needed
STATUS := ALLOCATESEGMENT (SEGMENT^ID, , , PIN);
! allocates a shared segment, which is shared
! using the PIN method with the segment given by
! SEGMENT^ID in the process identified by PIN
STATUS := ALLOCATESEGMENT (SEGMENT^ID, , FILENAME, %50000);
! allocates a shared segment, shared using the
! file name method