InitZone
void InitZone(growProc, masters, limitPtr, startPtr ); ProcPtr growProc ; address of code for grow requests; NIL=none short masters ; master pointers to allocate at a time
Ptr limitPtr ; address of end of zone +1 Ptr startPtr ; address of start of zone This creates a new heap zone, initializes its header and tail and makes it the
current zone. Most applications will not need to use multiple heap zones.
growProc is the address of a user- defined function, or NIL if no custom
procedure is desired. In a memory shortage for this zone, this
function is called as a request to obtain additional memory. See
masters is the desired initial number of master pointers needed for this zone
(i.e., the number of handles that will be needed). This value also
specifies the increment in which master pointers will be allocated
limitPtr is the address of the end of this zone +1 (i.e., the starting address
for any subsequently- created zones). This includes the header, data
area, and trailer.
startPtr is the address of the first byte in this zone; i.e., the address of the
zone header (the 52-byte Zone structure).
Notes: The zone created by this call includes a 52-byte header, a 12-byte
trailer, an 8-byte header for the master pointers and 4-bytes per master
pointer. Thus, the usable data space is:
limitPtr - startPtr - 64 - (8+(4*masters ) )
This number must not be less than 0; also note that calls to MoreMasters will further decrease the amount of available memory in the zone.
Use SetZone to switch between different heap zones.