Class

NSPointerFunctions

An instance of NSPointerFunctions defines callout functions appropriate for managing a pointer reference held somewhere else.

Overview

The functions specified by an instance of NSPointerFunctions are separated into two clusters—those that define “personality” such as “object” or "C-string”, and those that describe memory management issues such as a memory deallocation function. There are constants for common personalities and memory manager selections (see Memory and Personality Options).

NSHashTable, NSMapTable, and NSPointerArray use an NSPointerFunctions object to define the acquisition and retention behavior for the pointers they manage. Note, however, that not all combinations of personality and memory management behavior are valid for these collections. The pointer collection objects copy the NSPointerFunctions object on input and output, so you cannot usefully subclass NSPointerFunctions.

Subclassing Notes

NSPointerFunctions is not suitable for subclassing.

Nested Types

NSPointerFunctionsOptions

Defines the memory and personality options for an NSPointerFunctions object.

Symbols

Creating and Initializing an NSPointerFunctions Object

init(options: NSPointerFunctions.Options = [])

Returns an NSPointerFunctions object initialized with the given options.

Memory Configuration

var usesStrongWriteBarrier: Bool

Specifies whether, in a garbage collected environment, pointers should be assigned using a strong write barrier.

Deprecated
var usesWeakReadAndWriteBarriers: Bool

Specifies whether, in a garbage collected environment, pointers should use weak read and write barriers.

Deprecated

Constants

Options

Defines the memory and personality options for an NSPointerFunctions object.

Memory and Personality Options

Specify memory and personality options for an NSPointerFunctions object.

Relationships

Inherits From