SetApplLimit
Use the SetApplLimit procedure to set the application heap limit, beyond which the application heap cannot expand.
PROCEDURE SetApplLimit (zoneLimit: Ptr);
zoneLimit
- A pointer to a byte in memory demarcating the upper boundary of the application heap zone. The zone can grow to include the byte preceding
zoneLimit in memory, but no further.
DESCRIPTION
The SetApplLimit procedure sets the current application heap limit to zoneLimit. The Memory Manager then can expand the application heap only up to the byte preceding the application limit. If the zone already extends beyond the specified limit, the Memory Manager does not cut it back but does prevent it from growing further.
- Note
- The
zoneLimit parameter is not a byte count, but an absolute byte in memory. Thus, you should use the SetApplLimit procedure only with a value obtained from the Memory Manager functions GetApplLimit or ApplicationZone.
You cannot change the limit of zones other than the application heap zone.
ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for SetApplLimit are
| Registers on entry |
| A0 | Pointer to desired new zone limit |
| Registers on exit |
| D0 | Result code |
RESULT CODES
| noErr | 0 | No error |
| memFullErr | -108 | Not enough memory |
SEE ALSO
To use SetApplLimit to expand the default size of the stack, see the discussion in "Changing the Size of the Stack" on page 1-39.