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: Memory /
Chapter 1 - Introduction to Memory Management / Memory Management Reference
Memory Management Routines / Assessing Memory Conditions


PurgeSpace

Use the PurgeSpace procedure to determine the total amount of free memory and the size of the largest allocatable block after a purge of the heap.

PROCEDURE PurgeSpace (VAR total: LongInt; VAR contig: LongInt);
total
On exit, the total amount of free memory in the current heap zone if it were purged.
contig
On exit, the size of the largest contiguous block of free memory in the current heap zone if it were purged.
DESCRIPTION
The PurgeSpace procedure returns, in the total parameter, the total amount of space (in bytes) that could be obtained after a general purge of the current heap zone; this amount includes space that is already free. In the contig parameter, PurgeSpace returns the size of the largest allocatable block in the current heap zone that could be obtained after a purge of the zone.

The PurgeSpace procedure does not actually purge the current heap zone.

ASSEMBLY-LANGUAGE INFORMATION
The registers on exit for PurgeSpace are
Registers on exit
A0Maximum number of contiguous bytes after purge
D0Total free memory after purge

RESULT CODES
noErr 0No error

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996