![]() |
NewPtr |
||||
Header: | MacMemory.h | Carbon status: | Supported | |
Allocates a nonrelocatable block of memory of a specified size.
Ptr NewPtr ( Size byteCount );
The requested size (in bytes) of the nonrelocatable block.
A pointer to the new block. If NewPtr fails to allocate a block of the requested size, it returns NULL.
The NewPtr function attempts to reserve space as low in the heap zone as possible for the new block. If it is able to reserve the requested amount of space, NewPtr allocates the nonrelocatable block in the gap ReserveMem creates. Otherwise, NewPtr returns NULL and generates a memFullErr error.
Call the function MemError to get the result code. See
Because NewPtr allocates memory, you should not call it at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)