Class NSPointerFunctionsOptions


  • public final class NSPointerFunctionsOptions
    extends java.lang.Object
    NSPointerFunctions 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.
    • Field Summary

      Fields 
      Modifier and Type Field 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
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • StrongMemory

        public static final long StrongMemory
        use strong write-barrier to backing store; use GC memory on copyIn
        See Also:
        Constant Field Values
      • MallocMemory

        public static final long MallocMemory
        free() will be called on removal, calloc on copyIn
        See Also:
        Constant Field Values
      • WeakMemory

        public static final long WeakMemory
        uses weak read and write barriers appropriate for ARC
        See Also:
        Constant Field Values
      • ObjectPersonality

        public static final long ObjectPersonality
        use -hash and -isEqual, object description
        See Also:
        Constant Field Values
      • OpaquePersonality

        public static final long OpaquePersonality
        use shifted pointer hash and direct equality
        See Also:
        Constant Field Values
      • ObjectPointerPersonality

        public static final long ObjectPointerPersonality
        use shifted pointer hash and direct equality, object description
        See Also:
        Constant Field Values
      • CStringPersonality

        public static final 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
        See Also:
        Constant Field Values
      • StructPersonality

        public static final long StructPersonality
        use a memory hash and memcmp (using size function you must set)
        See Also:
        Constant Field Values
      • IntegerPersonality

        public static final long IntegerPersonality
        use unshifted value as hash & equality
        See Also:
        Constant Field Values
      • CopyIn

        public static final long CopyIn
        the memory acquire function will be asked to allocate and copy items on input
        See Also:
        Constant Field Values