Important: The information in this document is obsolete and should not be used for new development.
Chapter 2 - Memory Manager
This chapter describes how your application can use the Memory Manager to manage memory both in its own partition and outside its partition. Ordinarily, you allocate memory in your application heap only. You might, however, occasionally need to
access memory outside of your application partition, or you might want to create additional heap zones within your application partition.You need to read this chapter if you want to use Memory Manager routines other than those described in the chapter "Introduction to Memory Management" in this book. That chapter shows how to use the Memory Manager and other system software components to perform the most common memory-manipulation operations while avoiding heap fragmentation and low memory situations. This chapter addresses a number of other important memory-related issues.
This chapter begins with a description of areas of memory that are outside your application's partition and their typical uses. Then it describes how you can
This chapter also addresses some advanced topics that are generally of use only to developers of very specialized applications or memory utilities. These advanced
- allocate temporary memory
- allocate memory in and install code into the system heap
- read and change the values of system global variables
- allocate high memory during the startup process
- create additional heap zones within your application's partition
- install a purge-warning procedure for a heap zone
topics include
To use this chapter, you should be familiar with ordinary use of the Memory Manager and other system software components that allow you to manage memory, as described in the chapter "Introduction to Memory Management" earlier in this book.
- how the Memory Manager organizes heap zones
- how the Memory Manager organizes memory blocks
The "Memory Manager Reference" and "Summary of the Memory Manager" sections in this chapter provide a complete reference and summary of the constants, data types, and routines provided by the Memory Manager.
Chapter Contents
- About the Memory Manager
- Temporary Memory
- Multiple Heap Zones
- The System Global Variables
- Using the Memory Manager
- Reading and Writing System Global Variables
- Extending an Application's Memory
- Allocating Temporary Memory
- Determining the Features of Temporary Memory
- Using the System Heap
- Allocating Memory at Startup Time
- Creating Heap Zones
- Installing a Purge-Warning Procedure
- Organization of Memory
- Heap Zones
- Block Headers
- Memory Manager Reference
- Data Types
- Memory Manager Routines
- Setting Up the Application Heap
- Allocating and Releasing Relocatable Blocks of Memory
- Allocating and Releasing Nonrelocatable Blocks of Memory
- Changing the Sizes of Relocatable and Nonrelocatable Blocks
- Setting the Properties of Relocatable Blocks
- Managing Relocatable Blocks
- Manipulating Blocks of Memory
- Assessing Memory Conditions
- Freeing Memory
- Grow-Zone Operations
- Allocating Temporary Memory
- Accessing Heap Zones
- Manipulating Heap Zones
- Application-Defined Routines
- Grow-Zone Functions
- Purge-Warning Procedures
- Summary of the Memory Manager
- Pascal Summary
- Constants
- Data Types
- Memory Manager Routines
- Application-Defined Routines
- C Summary
- Constants
- Data Types
- Memory Manager Routines
- Application-Defined Routines
- Assembly-Language Summary
- Constants
- Data Structures
- Trap Macros
- Global Variables
- Result Codes