---
title: CFAllocatorContext
framework: corefoundation
role: symbol
role_heading: Structure
path: corefoundation/cfallocatorcontext
---

# CFAllocatorContext

A structure that defines the context or operating environment for an allocator (CFAllocator) object. Every Core Foundation allocator object must have a context defined for it.

## Declaration

```swift
struct CFAllocatorContext
```

## Overview

Overview See the Memory Management Programming Guide for Core Foundation topic for information on creating a custom CFAllocator object and, as part of that procedure, the steps for creating a properly initialized CFAllocatorContext structure.

## Topics

### Initializers

- [init()](corefoundation/cfallocatorcontext/init().md)
- [init(version:info:retain:release:copyDescription:allocate:reallocate:deallocate:preferredSize:)](corefoundation/cfallocatorcontext/init(version:info:retain:release:copydescription:allocate:reallocate:deallocate:preferredsize:).md)

### Instance Properties

- [allocate](corefoundation/cfallocatorcontext/allocate.md)
- [copyDescription](corefoundation/cfallocatorcontext/copydescription.md)
- [deallocate](corefoundation/cfallocatorcontext/deallocate.md)
- [info](corefoundation/cfallocatorcontext/info.md)
- [preferredSize](corefoundation/cfallocatorcontext/preferredsize.md)
- [reallocate](corefoundation/cfallocatorcontext/reallocate.md)
- [release](corefoundation/cfallocatorcontext/release.md)
- [retain](corefoundation/cfallocatorcontext/retain.md)
- [version](corefoundation/cfallocatorcontext/version.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
