OSStatus PoolDeallocate (LogicalAddress address);
The PoolDeallocate routine returns the chunk of memory at address to the pool from which it was allocated. It can be used to deallocate memory that was allocated with PoolAllocateResident.
PoolDeallocate may be called only from task level, not from secondary or hardware interrupt level.
noErr
|
0 | No error |
qErr
|
-1 | Queue element not found |
memFullErr
|
-108 | Not enough room in heap |
The code shown in Listing 11-2 uses PoolDeallocate to dispose of a property that was obtained by calling the RegistryPropertyGet function.
Listing 11-2 Disposing of a property
void DisposeThisProperty(
RegPropertyValue *regPropertyValuePtr
)
{
if(*regPropertyValuePtr!=NULL){
PoolDeallocate(*regPropertyValuePtr);
*regPropertyValuePtr=NULL;
}
}