Important: The information in this document is obsolete and should not be used for new development.
MaxMem
Use theMaxMemfunction to compact and purge the current heap zone.
FUNCTION MaxMem (VAR grow: Size): Size;
grow- On exit, the maximum number of bytes by which the current heap zone can grow. After a call to
MaxApplZone,MaxMemalways returns 0 in this parameter.DESCRIPTION
TheMaxMemfunction compacts the current heap zone and purges all relocatable, unlocked, and purgeable blocks from the zone. It returns the size, in bytes, of the largest contiguous free block in the zone after the compacting and purging. If the current zone is the original application zone, thegrowparameter is set to the maximum number of bytes by which the zone can grow. For any other heap zone,growis set to 0.MaxMemdoesn't actually expand the zone or call the zone's grow-zone function.SPECIAL CONSIDERATIONS
BecauseMaxMemmoves and purges memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on exit forMaxMemare
Registers on exit A0 Number of bytes zone can grow D0 Size in bytes of largest allocatable block The
MaxMemfunction compacts the current heap zone. If you want to compact and purge the system heap zone rather than the current heap zone, set bit 10 of the routine trap word. In most development systems, you can do this by supplying the wordSYSas the second argument to the routine macro, as follows:
_MaxMem ,SYSRESULT CODES
noErr 0 No error