Function

CFGetAllocator

Returns the allocator used to allocate a Core Foundation object.

Declaration

CFAllocatorRef CFGetAllocator(CFTypeRef cf);

Parameters

cf

The CFType object to examine.

Return Value

The allocator used to allocate memory for cf.

Discussion

When you are creating a Core Foundation object sometimes you want to ensure that the block of memory allocated for the object is from the same allocator used for another object. One way to do this is to reuse the allocator assigned to an existing Core Foundation object when you call a “creation” function.

See Also

Memory Management

CFGetRetainCount

Returns the reference count of a Core Foundation object.

CFMakeCollectable

Makes a newly-allocated Core Foundation object eligible for garbage collection.

CFRelease

Releases a Core Foundation object.

CFRetain

Retains a Core Foundation object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software