Important: The information in this document is obsolete and should not be used for new development.
MoreMasters
Call theMoreMastersprocedure 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
TheMoreMastersprocedure 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
MoreMastersonce for every new heap zone, including the application heap zone.You should call
MoreMastersat 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 theMoreMastersshould be enough. It's better to callMoreMasterstoo 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, callMoreMastersenough times at the beginning of the program to accommodate times of greater memory use.If you are forced to call
MoreMastersso many times that it causes a significant slowdown, you could change themoreMastfield of the zone header to the total number of master pointers you need and then callMoreMastersjust once. Afterward, be sure to restore themoreMastfield to its original value.SPECIAL CONSIDERATIONS
BecauseMoreMastersallocates memory, you should not call it at interrupt time.The calls to
MoreMastersat 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 forMoreMastersare
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 theInitZoneprocedure on page 2-86 for details.