OS X Version 10.5 Delta

The low-level Objective-C runtime API is significantly updated in OS X version 10.5. Many functions and all existing data structures are replaced with new functions. This document describes the differences between the 10.5 version and previous versions.

Runtime Functions

Basic types

arith_t: Changed from int to intptr_t.

uarith_t: Changed from unsigned to uintptr_t.

Instances

The following functions are unchanged:

The following function is modified:

  • object_copy (The nBytes parameter is changed from unsigned to size_t.)

The following functions are added:

The following functions are deprecated:

  • object_copyFromZone: deprecated in favor of object_copy

  • object_realloc

  • object_reallocFromZone: no substitute

  • _alloc: no substitute

  • _copy: no substitute

  • _realloc: no substitute

  • _dealloc: no substitute

  • _zoneAlloc: no substitute

  • _zoneRealloc: no substitute

  • _zoneCopy: no substitute

  • _error: no substitute

Class Inspection

The following functions are unchanged:

The following function is modified:

  • class_createInstance: idxIvars parameter Changed from unsigned to size_t

The following functions are added:

The following functions are deprecated:

The following function is used only by ZeroLink:

  • objc_getRequiredClass

Class Manipulation

The following function is unchanged:

The following functions are added:

The following functions are deprecated:

Methods

The following function is unchanged:

The following functions are added:

The following functions are deprecated:

  • method_getArgumentInfo

  • method_getSizeOfArguments

Instance Variables

The following functions are added:

Selectors

The following functions are unchanged:

The following function is added:

The following function is deprecated:

  • sel_isMapped: deprecated with no substitute

Runtime

The following functions are deprecated favor of dyld:

  • objc_loadModules

  • objc_loadModule

  • objc_unloadModules

The following functions are deprecated:

  • objc_setClassHandler: deprecated with no substitute

  • objc_setMultithreaded: deprecated with no substitute

The following previously undocumented functions are deprecated with no substitute:

  • objc_getOrigClass

  • _objc_create_zone

  • _objc_error

  • _objc_flush_caches

  • _objc_resolve_categories_for_class

  • _objc_setClassLoader

  • _objc_setNilReceiver

  • _objc_getNilReceiver

  • _objcInit

The following undocumented functions are unchanged:

  • _objc_getFreedObjectClass

  • instrumentObjcMessageSends

  • _objc_debug_class_hash

  • _class_printDuplicateCacheEntries

  • _class_printMethodCaches

  • _class_printMethodCacheStatistics

Messaging

The following functions are unchanged:

The following functions are removed:

objc_msgSendv
objc_msgSendv_stret
objc_msgSendv_fpret

Protocols

The following functions are added:

Exceptions

The following functions are unchanged:

  • objc_exception_throw

  • objc_exception_try_enter

  • objc_exception_try_exit

  • objc_exception_extract

  • objc_exception_match

  • objc_exception_get_functions

  • objc_exception_set_functions

Synchronization

The following functions are unchanged:

  • objc_sync_enter

  • objc_sync_exit

  • objc_sync_wait

  • objc_sync_notify

  • objc_sync_notifyAll

These functions are only used by the compiler.

NXHashTable and NXMapTable

NXHashTable and NXMapTable are unchanged. They are limited to 4 billion entries.

Structures

The objc_super struct is unchanged:

struct objc_super {
    id receiver;
    Class super_class;
};

All other structures deprecated in favor of opaque types and functional API. Substitutes are shown in the following tables.

Table B-1  Substitutions for objc_class

Variable

Substitution

struct objc_class *isa;

object_getClass(), object_setClass()

struct objc_class *super_class;

class_getSuperclass()

const char *name;

class_getName()

long version;

class_getVersion(), class_setVersion()

long info;

class_isMetaClass()

long instance_size;

no substitute

struct objc_ivar_list *ivars;

class_copyIvarList(), class_addIvar()

struct objc_method_list **methodLists;

class_copyMethodList(), class_addMethod()

struct objc_cache *cache;

no substitute

struct objc_protocol_list *protocols;

class_copyProtocolList(), class_addProtocol()

Table B-2  Substitutions for objc_method

Variable

Substitution

SEL method_name;

method_getName()

char *method_types;

method_getTypeEncoding()

IMP method_imp;

method_getImplementation(), method_setImplementation()

Table B-3  Substitutions for objc_ivar

Variable

Substitution

char *ivar_name;

ivar_getName()

char *ivar_type;

ivar_getTypeEncoding()

int ivar_offset;

ivar_getOffset()

There are no substitutes for the following structs: