![]() |
PurgeMem |
||||
Header: | MacMemory.h | Carbon status: | Supported | |
Purges the current heap zone.
void PurgeMem ( Size cbNeeded );
The size, in bytes, of the block for which PurgeMem should attempt to make room.
The Memory Manager purges the heap automatically when a memory request fails. However, you can use PurgeMem to purge the current heap zone manually.
The PurgeMem function sequentially purges blocks from the current heap zone until it either allocates a contiguous block of the specified size or purges the entire zone. If PurgeMem purges the entire zone without creating a contiguous block of the specified size, PurgeMem generates the result code memFullErr.
Call the function MemError to get the result code. See
The PurgeMem function purges only relocatable, unlocked, purgeable blocks. The function does not actually attempt to allocate the memory.
To purge the entire heap zone, call PurgeMem(maxSize).
Because PurgeMem purges 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)