Important: The information in this document is obsolete and should not be used for new development.
MoreMasters
Call theMoreMasters
procedure several times at the beginning of your program to prevent the Memory Manager from running out of master pointers in the middle of application execution. If it does run out, it allocates more, possibly causing heap fragmentation.
PROCEDURE MoreMasters;DESCRIPTION
TheMoreMasters
procedure allocates another block of master pointers in the current heap zone. In the application heap, a block of master pointers consists of 64 master pointers, and in the system heap, a block consists of 32 master pointers. (These values, however, might change in future versions of system software.) When you initialize additional heap zones, you can specify the number of master pointers you want to have in a block of master pointers.The Memory Manager automatically calls
MoreMasters
once for every new heap zone, including the application heap zone.You should call
MoreMasters
at the beginning of your program enough times to ensure that the Memory Manager never needs to call it for you. For example, if your application never allocates more than 300 relocatable blocks in its heap zone, then five calls to theMoreMasters
should be enough. It's better to callMoreMasters
too many times than too few. For instance, if your application usually allocates about 100 relocatable blocks but might allocate 1000 in a particularly busy session, callMoreMasters
enough times at the beginning of the program to accommodate times of greater memory use.If you are forced to call
MoreMasters
so many times that it causes a significant slowdown, you could change themoreMast
field of the zone header to the total number of master pointers you need and then callMoreMasters
just once. Afterward, be sure to restore themoreMast
field to its original value.SPECIAL CONSIDERATIONS
BecauseMoreMasters
allocates memory, you should not call it at interrupt time.The calls to
MoreMasters
at the beginning of your application should be in the main code segment of your application or in a segment that the main segment never unloads.ASSEMBLY-LANGUAGE INFORMATION
The registers on exit forMoreMasters
are
Registers on exit D0 Result code RESULT CODES
noErr 0 No error memFullErr -108 Not enough memory SEE ALSO
If you initialize a new zone, you can specify the number of master pointers that a master pointer block should contain. See the description of theInitZone
procedure on page 2-86 for details.