Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Programmer's Guide to MacApp / Part 2 - Working With MacApp


Chapter 24 -
Working With Memory and Failure Handling

This chapter describes how to use MacApp's memory management routines to allocate memory and ensure that critical allocations are successful. It also describes how to use MacApp's failure-handling mechanism in your application.

This chapter includes recipes and sample code that demonstrate how to

For a detailed description of MacApp memory management and failure handling, see Chapter 3, "Core Technologies."


Chapter Contents
Memory Overview
Ensuring That Critical Memory Requests Succeed
Managing Object Allocation Efficiently
Allocating Permanent and Temporary Memory
MacApp's Memory Allocation Routines
Allocating Permanent Memory
Allocating Temporary Memory
Allocating Memory for Objects
Allocating Memory for Lists
Allocating Memory for List and Objects
Allocating Master Pointers for the Application
'mem!', '68k!', and 'ppc!' Resources
Recipes--Memory (68K Only)
Recipe--Defining Segment Names for Your Application
Recipe--Defining a 'res!' Resource
Identify Code That Should Always Be Resident
Map Related Code to the Same Segment
Create a 'res!' Resource That Lists Resident Segments
Recipe--Defining a 'seg!' Resource
Identify Segments in Memory at Greatest Memory Usage
Identify MacApp Segments Also in Memory
Create a 'seg!' Resource That Lists the Segments
Failure-Handling Overview
MacApp Error-Checking Routines
The Failure Routine
How Error Messages Are Displayed
Setting the Error Message in a Failure Handler
Calling the Failure Routine Directly
Recipes--Failure Handling
Recipe--Avoiding Register Variables in Failure Handlers

Previous Book Contents Book Index Next

© Apple Computer, Inc.
25 JUL 1996