Important: The information in this document is obsolete and should not be used for new development.
InitZone
If you want to use heap zones other than the original application heap zone, a temporary memory zone, or the system heap zone, you can use theInitZone
procedure to initialize a new heap zone.
PROCEDURE InitZone (pGrowZone: ProcPtr; cMoreMasters: Integer; limitPtr, startPtr: Ptr);
pGrowZone
- A pointer to a grow-zone function for the new heap zone. If you do not want the new zone to have a grow-zone function, set this parameter
toNIL
.cMoreMasters
- The number of master pointers that should be allocated at a time for the new zone. The Memory Manager allocates this number initially, and, if it needs to allocate more later, allocates them in increments of this same number.
limitPtr
- The first byte beyond the end of the zone.
startPtr
- The first byte of the new zone.
DESCRIPTION
TheInitZone
procedure creates a new heap zone, initializes its header and trailer, and makes it the current zone. Although the new zone occupies memory addresses fromstartPtr
throughlimitPtr-1
, the new zone includes a zone header and a zone trailer. In addition, the new zone contains a block header for the master pointer block and 4 bytes for each master pointer. If you need to create a zone with some specific number of usable bytes, see "Organization of Memory," beginning on page 2-19, for details on the sizes of the zone header, zone trailer, and block header.
- Note
- The sizes of zones and block headers may change in future system software versions. You should ensure that your zones are large enough to accommodate a reasonable increase in the sizes of those structures.
SPECIAL CONSIDERATIONS
BecauseInitZone
changes the current zone, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forInitZone
are
Registers on entry A0 Pointer to parameter block
Registers on exit D0 Result code The parameter block whose address is passed in register A0 has no Pascal type definition. It has this structure:
--> startPtr Ptr
The first byte of the new zone. --> limitPtr Ptr
The first byte beyond the new zone. --> cMoreMasters Integer
The number of master pointers to be allocated at a time. --> pGrowZone ProcPtr
A pointer to the new zone's grow-zone function, or NIL
if none.RESULT CODES
noErr 0 No error