Important: The information in this document is obsolete and should not be used for new development.
PurgeSpace
Use thePurgeSpace
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
ThePurgeSpace
procedure returns, in thetotal
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 thecontig
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 forPurgeSpace
are
Registers on exit A0 Maximum number of contiguous bytes after purge D0 Total free memory after purge If you want to test the system heap zone instead of the current zone, set bit 10 of the routine trap word. In most development systems, you can do this by supplying the word
SYS
as the second argument to the routine macro, as follows:
_PurgeSpace ,SYSRESULT CODES
noErr 0 No error