Guardian Programmer's Guide

Table Of Contents
Managing Memory
Guardian Programmer’s Guide 421922-014
17 - 2
Managing the User Data Areas
Managing the User Data Areas
The structure of the areas of memory used by a process for user data differs for TNS
processes and native processes.
Managing the TNS User Data Segment
In a TNS process, the user data segment provides up to 128K bytes of data storage for
global variables, local variables, and return information for procedure calls. The lower
64K bytes of the user data segment are managed for you as a data stack by the
operating system. To access the upper 64K bytes, you manage the data yourself if
your program is written in TAL. Other languages use the upper 64K bytes for run-time
environments. Refer to the Common Run-Time Environment (CRE) Programmer’s
Guide for details.
Figure 17-1 shows the user data segment.
It is possible for your TNS program to use more than 128K bytes of memory. See
Using (Extended) Data Segments later in this section for details.
SEGMENT_GETINFO_ Returns information about an allocated extended
data segment. The information returned may
include the size of the extended data segment or the
name of the associated swap file.
SEGMENT_USE_ Makes a selectable segment current. The current
selectable segment is the only selectable segment
that your process can access. (A flat segment need
not be made current; your process can access all
allocated flat segments.)
SETMODE Option 141 can be used to speed large transfers of
data between an extended data segment and a file.
Figure 17-1. The User Data Segment
VST087.VSD