Extending an Application's Available Memory
In the Macintosh multitasking environment, each application is limited to a
particular memory partition (the size of which is determined by information
in the 'SIZE' resource of that application). The size of your application's
memory partition places certain limits on how big your application heap can
become and hence on how large the buffers and other data structures that your
application uses can be. If for some purpose you need more memory than is
currently available in your application heap, you can ask the Operating System
to let you use any available memory that is not yet allocated to any other
application. This memory is known as temporary memory and is allocated
from the available unused RAM; in general, that memory is not contiguous
with the memory in the requesting application's zone. The figure below shows
an application using some temporary memory.
Your application should use temporary memory only for occasional
short-term purposes that could be accomplished in less space, though perhaps
less efficiently. One good reason for using temporary memory only
occasionally is that you cannot assume that you will always receive the
temporary memory you request. For example, in the Figure in the section
available memory is used by the two applications; any requests by either one
for some temporary memory would fail.
‡
Using temporary memory
Note that temporary memory is provided by the Operating System and not
space only within your application heap or the system heap). In system 7.0,
however, you can free temporary memory by using normal
operating-system routines to allocate temporary memory. There are also
special routines to lock, unlock, and free temporary memory.