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 / Setting Up the Application Heap


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
A0Pointer to desired new zone limit
Registers on exit
D0Result code

RESULT CODES
noErr0No error
memFullErr-108Not 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996