Gets the default allocator object for the current thread.


func CFAllocatorGetDefault() -> Unmanaged<CFAllocator>!

Return Value

A reference to the default allocator for the current thread. If none has been explicitly set, returns the generic system allocator, kCFAllocatorSystemDefault. Ownership follows The Get Rule.


See the discussion for CFAllocatorSetDefault(_:) for more detail on the default allocator and for advice on how and when to set a custom allocator as the default.

See Also

Getting and Setting the Default Allocator

func CFAllocatorSetDefault(CFAllocator!)

Sets the given allocator as the default for the current thread.

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