public final class NSPointerFunctionsOptions
extends java.lang.Object
This object defines callout functions appropriate for managing a pointer reference held somewhere else.
Used by NSHashTable, NSMapTable, and NSPointerArray, this object defines the acquision and retention behavior for the pointers provided to these collection objects.
The functions are separated into two clusters - those that define "personality", such as object or cString, and those that describe memory management issues such as a memory deallocation function. Common personalities and memory manager selections are provided as enumerations, and further customization is provided by methods such that the composition of the actual list of functions is done opaquely such that they can be extended in the future.
The pointer collections copy NSPointerFunctions objects on input and output, and so NSPointerFunctions is not usefully subclassed.
| Modifier and Type | Field and Description |
|---|---|
static long |
CopyIn
the memory acquire function will be asked to allocate and copy items on input
|
static long |
CStringPersonality
use a string hash and strcmp, description assumes UTF-8 contents; recommended for UTF-8 (or ASCII, which is a subset) only cstrings
|
static long |
IntegerPersonality
use unshifted value as hash & equality
|
static long |
MachVirtualMemory |
static long |
MallocMemory
free() will be called on removal, calloc on copyIn
|
static long |
ObjectPersonality
use -hash and -isEqual, object description
|
static long |
ObjectPointerPersonality
use shifted pointer hash and direct equality, object description
|
static long |
OpaqueMemory |
static long |
OpaquePersonality
use shifted pointer hash and direct equality
|
static long |
StrongMemory
use strong write-barrier to backing store; use GC memory on copyIn
|
static long |
StructPersonality
use a memory hash and memcmp (using size function you must set)
|
static long |
WeakMemory
uses weak read and write barriers appropriate for ARC
|
public static final long StrongMemory
public static final long OpaqueMemory
public static final long MallocMemory
public static final long MachVirtualMemory
public static final long WeakMemory
public static final long ObjectPersonality
public static final long OpaquePersonality
public static final long ObjectPointerPersonality
public static final long CStringPersonality
public static final long StructPersonality
public static final long IntegerPersonality
public static final long CopyIn