![]() |
NewPtrClear |
||||
Header: | MacMemory.h | Carbon status: | Supported | |
Allocates a nonrelocatable block of memory of a specified size with all its bytes set to 0.
Ptr NewPtrClear ( Size byteCount );
The requested size (in bytes) of the nonrelocatable block.
A pointer to the new block. If NewPtrClear fails to allocate a block of the requested size, it returns NULL.
The NewPtrClear function works much as the NewPtr function does, but sets all bytes in the new block to 0 instead of leaving the contents of the block undefined.
Currently, NewPtrClear clears the block one byte at a time. For a large block, it might be faster to write your own code to clear the block.
Call the function MemError to get the result code. See
Because NewPtrClear 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)