DLL Programmer's Guide for TNS/R Systems
Sample Sessions and Usage Notes
DLL Programmer’s Guide for TNS/R Systems—522203-002
6-18
Guardian Fundamentals
This is no regression for DLLs on TNS/R because there has never been dynamic
loading before. The position is consistent with others taken in the past, most notably
the incompatibility of C and C++ heap operations with passive checkpoint. There is no
way to cause the passive backup to capture heap allocations and deallocations,
whether explicit via malloc() or new, or implicit in any number of functions. Because
heap operations are often pervasive in C and C++ programs, the incompatibility is
often exaggerated slightly to “C and C++ do not support passive checkpoint.”
Furthermore, OSS does not support process pairs.
Extra Space For Loading DLLs
At G06.21, the operating system has been revised to load DLLs automatically in the
user data space when the area reserved for DLLs is exhausted.
When a DLL cannot be loaded at its preferred address (because the address range is
unavailable), the operating system attempts to load it elsewhere. If that attempt fails,
the load attempt is aborted.
For static loading, the failure is reported as process creation error 77, detail 4, and a
message is displayed containing "Insufficient address space available." For dynamic
loading, dlopen() returns 0; then dlresultcode() reports the same codes (77 << 16 + 4),
and dlerror() reports the same text.
When building a DLL, the user can specify to the linker the preferred address range at
which to load it. By default, the linker assigns an address range at the beginning of the
DLL reservation (128 MB beginning at 0x60000000).
At load time, if the specified area is available, and falls within either the DLL
reservation or the larger user data area (shared with the program's global data, heap,
and flat segments), the DLL will be loaded at its preferred addresses.
If the preferred address range is unavailable, the operating system attempts to assign
another available area for that DLL in this process. In the original implementation
(T9050 AOW, G06.20), this area came only from the DLL reservation. In T9050 AOY,
G06.21, the operating system will attempt first to find space in the DLL reservation;
failing that, it will attempt to find space in the flat-segment area (competing with
SEGMENT_ALLOCATE_). Only if both attempts fail will the load of the DLL fail for
lack of space.