Open System Services Programmer's Guide
NOTE: 32-bit processes—whether OSS or Guardian—can only access 64-bit memory through
flat segments that are allocated using the SEGMENT_ALLOCATE64_ Guardian procedure.
You can use SEGMENT_ALLOCATE64_ to share 64-bit memory segments between 32-bit and
64-bit processes. SEGMENT_ALLOCATE64_ is similar to SEGMENT_ALLOCATE_ and it allocates
a flat segment in the 64-bit space. For information about SEGMENT_ALLOCATE64_, see the
Guardian Procedure Calls Reference Manual in the NTL.
TNS and native processes can share segments in 32-bit address space, using
SEGMENT_ALLOCATE_ with either the share-by-pin or share-by-filename method. TNS/E 32-bit
or 64-bit native processes can also use SEGMENT_ALLOCATE64_ to share 32-bit segments. TNS
and TNS/E native processes cannot share shm*() segments with each other. On TNS/R systems,
native and TNS OSS processes can share shm*() segments, but native Guardian processes cannot
share them with OSS processes (native or TNS).
IMPORTANT: HP does not recommend attempting to share selectable segments among any of
the following:
• Programs using the wide-memory model, such as:
◦ TNS C
◦ COBOL
◦ FORTRAN
• TNS TAL programs that uses global or local data with .EXT indirection
For additional information about sharing selectable segments, see Using Selectable Segments in
TNS Processes in the Guardian Programmer’s Guide.
The following new 64-bit segment routines have been added, beginning with the H06.20 and
J06.09 RVUs:
• ADDRESS_DELIMIT64_
• REFPARAM_BOUNDSCHECK64_
• SEGMENT_ALLOCATE64_
• SEGMENT_GETINFO64_
• SEGMENT_GETINFOSTRUCT_
• SEGMENT_RESIZE64_
• SEGMENT_GET_PREF_ALIGN_
• SEGMENT_GET_MIN_ALIGN_
A 32-bit process can allocate virtual memory using SEGMENT_ALLOCATE64_. It can then define
a 64-bit pool on that memory using POOL64_DEFINE_, if desired, so that it can allocate and
de-allocate from that memory dynamically. All access to the 64-bit segment must be done using
64-bit pointers.
64-bit pool routines can be used for dynamic allocation and de-allocation (kpool64.h) and
provide improved performance over traditional NonStop pool management. A pool need not be
a contiguous block of virtual memory. The pool can be increased by allocating an additional
segment and augmenting the pool to include that segment.
For more information about 64-bit pool functions, see “Pool Functions” (page 165).
Sharing Memory Between 32-Bit and 64-Bit Processes 291