<!--
{
  "documentType" : "article",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/predefined-allocators",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Predefined Allocators"
}
-->

# Predefined Allocators

CFAllocator provides the following predefined allocators. In general, you should use `kCFAllocatorDefault` unless one of the special circumstances exist below.

## Topics

### Constants

[`kCFAllocatorDefault`](/documentation/CoreFoundation/kCFAllocatorDefault)

This is a synonym for `NULL`.

[`kCFAllocatorSystemDefault`](/documentation/CoreFoundation/kCFAllocatorSystemDefault)

Default system allocator.

[`kCFAllocatorMalloc`](/documentation/CoreFoundation/kCFAllocatorMalloc)

This allocator uses `malloc()`, `realloc()`, and `free()`.

[`kCFAllocatorMallocZone`](/documentation/CoreFoundation/kCFAllocatorMallocZone)

This allocator explicitly uses the default malloc zone, returned by `malloc_default_zone()`.

[`kCFAllocatorNull`](/documentation/CoreFoundation/kCFAllocatorNull)

This allocator does nothing—it allocates no memory.

[`kCFAllocatorUseContext`](/documentation/CoreFoundation/kCFAllocatorUseContext)

Special allocator argument to [`CFAllocatorCreate(_:_:)`](/documentation/CoreFoundation/CFAllocatorCreate(_:_:))—it uses the functions given in the context to allocate the allocator.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)