MoreMasters
MoreMasters
Create an additional block of master pointers MoreMasters allocates an additional block of master pointers for the current heap zone.
memFullErr (-108) No room for additional master pointers
Notes: This function is called automatically when you request a new handle and
there are no more master pointers available. Since it's tidy to have master
pointers low in the heap, a common operation is to call MoreMasters one or more times very early in the application.
If you have an " initialization" segment that you later unload, make sure
that you don't call MoreMasters from there. This would leave an empty spot underneath your master pointer blocks, and would consequently
fragment your heap. If you always call MoreMasters from the segment that contains main(), you should be OK.
By default, this allocates a block of 64 master pointers (if the application
heap zone is current) or 32 (if the system heap zone is current). For
user- created zones, this increment is set in the InitZone call. The actual number allocated is found in the moreMast field of the current Zone record This call reduces the amount of available storage by
8+(TheZone->moreMast * 4).
You can determine how many times you will need to call MoreMasters for your application, since each call to MoreMasters allocates a 256-byte non-relocatable block. When your program is almost finished, take out all
calls to MoreMasters and run your program through all of its paces. After exercising your program for a while, use Macsbug's HD command (or
TMON's Heap Window) to check for pointer blocks of 0x100 bytes. Use the
number of blocks to determine how many times to call MoreMasters. To be safe, you should give yourself about 20% extra blocks. It's much better
to allocate too many blocks that too few.