![]() |
MoreMasters |
||||
Header: | MacMemory.h | Carbon status: | Not Recommended | |
Allocates a block of master pointers in the current heap zone.
void MoreMasters ();
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 are likely to increase 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 the MoreMasters function once for every new heap zone, including the application heap zone.
Call MoreMasters 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.
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 the MoreMasters should be enough. Its better to call MoreMasters 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, call MoreMasters enough times to accommodate the largest amount.
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 the function InitZone for details.
Call the MemError function to get the result code. See
Because MoreMasters 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.
Not recommended in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
You should instead use MoreMasterPointers.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)