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: QuickDraw GX Environment and Utilities /
Chapter 2 - QuickDraw GX Memory Management / About QuickDraw GX Memory Management


Graphics Clients and Graphics Client Heaps

At system startup, QuickDraw GX does not have any memory available in which to do work. To allocate memory, it needs a special QuickDraw GX object called a graphics client. This object is associated with a graphics client heap.

Because a graphics client stores bookkeeping data for its heap, including the memory starting address and the size of all of the heap's memory blocks, a graphics client can be associated with only one QuickDraw GX graphics client heap. A graphics client also stores the error, warning, and notice state.

An application heap is allocated by the Macintosh Memory Manager when an application is launched. This is the memory region used by your application for its own code and data structures. Graphics clients and their heaps are never allocated from memory blocks that have been allocated to the application heap.

QuickDraw GX provides functions to create a new graphics client and its graphics client heap. If you don't use these functions in your application, QuickDraw GX will call them for you to create a graphics client having a default memory size and location.

When you no longer need a graphics client and its heap, you dispose of them to release memory blocks. QuickDraw GX provides functions so that your application can dispose of a graphics client and its graphics client heap, but if you don't use these functions in your application, QuickDraw GX calls them for you at the appropriate time. Whenever an application requires memory allocation, QuickDraw GX automatically deallocates as many graphics client heap memory blocks as it needs to in order to satisfy the application's memory requirements. QuickDraw GX never deallocates graphics client heaps while they are in use. If QuickDraw GX cannot find sufficient memory blocks, it may automatically unload objects from memory to storage disk. QuickDraw GX automatically reloads these objects from storage disk to memory as it needs them.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996