Deallocates a block of memory with a given allocator.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
void CFAllocatorDeallocate(CFAllocator Ref allocator, void *ptr);
Parameters
allocator
The allocator that was used to allocate the block of memory pointed to by
ptr
.ptr
An untyped pointer to a block of memory to deallocate using
allocator
.
Discussion
If the allocator does not specify a deallocate
callback function, the memory is not deallocated.
Special Considerations
You must use the same allocator to deallocate memory as was used to allocate it.