GDSX Manual
Design and Development
Extended General Device Support (GDSX) Manual–134303
2-19
User Data Segment
Although it is generally not advisable, USCODE can use its own extended segment
through calls to ALLOCATESEGMENT and USESEGMENT. The segment IDs
available to USCODE range from 0 to 1023. The segment IDs from 1024 up are
reserved for TSCODE. A segment allocated by USCODE cannot be checkpointed with
a call to ^CHECKPOINT(2), so this kind of space should be considered temporary
working storage.
For information on the five memory pools, see "Memory Pools" on page 2-23.
User Data Segment
The user data segment of the GDSX process is specified at bind time to have a size of
64K words. The size of various areas within the segment is determined by the
configuration parameters. (See "GDSX Configuration Parameters" on page 2-42.)
Figure 2-1 shows the usage of the user data segment, along with algorithms that
determine space allocations. The bold line below the free space area marks the
boundary between the lower 32K words and the upper 32K words.
The working data stack is limited to 2000 words. This stack area is the local variable
space used by an executing DEVICE^HANDLER or LINE^HANDLER task, plus a
reserved space (up to 350 words may be needed) for the executing task’s calls to system
and TSCODE procedures. Therefore, the maximum size of the task’s data stack image
(configuration parameter TASKSIZE) is 1650 words (equal to 2000 minus 350).
Caution. If a user task uses its own segment, it must not relinquish control until the segment
ID previously used by TSCODE has been restored. In other words, if TSCODE uses segment
m and transfers control to USCODE, when USCODE next relinquishes control to TSCODE,
TSCODE expects the segment ID to be m.
Caution. In general, in USCODE the dynamic allocation of extended memory (with an
extended pointer, for example) should be avoided, because the TAL compiler would allocate
such space in extended segment 1024, which is reserved for use by TSCODE.
Caution. Exceeding these limits may produce unpredictable results at run time.