#include <os/object.h>

os/object.h

@header @preprocinfo By default, libSystem objects such as GCD and XPC objects are declared as Objective-C types when building with an Objective-C compiler. This allows them to participate in ARC, in RR management by the Blocks runtime and in leaks checking by the static analyzer, and enables them to be added to Cocoa collections. NOTE: this requires explicit cancellation of dispatch sources and xpc connections whose handler blocks capture the source/connection object, resp. ensuring that such captures do not form retain cycles (e.g. by declaring the source as __weak). To opt-out of this default behavior, add -DOS_OBJECT_USE_OBJC=0 to your compiler flags. This mode requires a platform with the modern Objective-C runtime, the Objective-C GC compiler option to be disabled, and at least a Mac OS X 10.8 or iOS 6.0 deployment target.
includes: Availability.h, os/availability.h, TargetConditionals.h, os/base.h
20 macros · 2 functions

macroOS_OBJECT_ASSUME_ABI_SINGLE_BEGIN

#define OS_OBJECT_ASSUME_ABI_SINGLE_BEGIN OS_ASSUME_PTR_ABI_SINGLE_BEGIN

macroOS_OBJECT_ASSUME_ABI_SINGLE_END

#define OS_OBJECT_ASSUME_ABI_SINGLE_END OS_ASSUME_PTR_ABI_SINGLE_END

macroOS_OBJECT_HAVE_OBJC_SUPPORT

#define OS_OBJECT_HAVE_OBJC_SUPPORT 0

macroOS_OBJECT_USE_OBJC

Unsupported platform for OS_OBJECT_USE_OBJC=1
#define OS_OBJECT_USE_OBJC 0

macroOS_OBJECT_SWIFT3

#define OS_OBJECT_SWIFT3 0

macroOS_OBJECT_ASSUME_NONNULL_BEGIN

#define OS_OBJECT_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")

macroOS_OBJECT_ASSUME_NONNULL_END

#define OS_OBJECT_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")

macroOS_OBJECT_WARN_UNUSED_RESULT

#define OS_OBJECT_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))

macroOS_OBJECT_RETURNS_RETAINED

@parseOnly
#define OS_OBJECT_RETURNS_RETAINED 

macroOS_OBJECT_CONSUMED

@parseOnly
#define OS_OBJECT_CONSUMED 

macroOS_OBJECT_BRIDGE

@parseOnly
#define OS_OBJECT_BRIDGE 

macroOS_WARN_RESULT_NEEDS_RELEASE

@parseOnly
#define OS_WARN_RESULT_NEEDS_RELEASE OS_WARN_RESULT

macroOS_OBJECT_OBJC_RUNTIME_VISIBLE

@parseOnly
#define OS_OBJECT_OBJC_RUNTIME_VISIBLE 

macroOS_OBJECT_USE_OBJC_RETAIN_RELEASE

#define OS_OBJECT_USE_OBJC_RETAIN_RELEASE 0

macroOS_OBJECT_DECL_CLASS

#define OS_OBJECT_DECL_CLASS(name) typedef struct name##_s *name##_t

macroOS_OBJECT_DECL_SENDABLE_CLASS

#define OS_OBJECT_DECL_SENDABLE_CLASS(name) typedef struct name##_s *name##_t

macroOS_OBJECT_DECL_PROTOCOL

#define OS_OBJECT_DECL_PROTOCOL(name, ...) 

macroOS_OBJECT_SHOW_CLASS

#define OS_OBJECT_SHOW_CLASS(name, ...) typedef struct name##_s *name##_t

macroOS_OBJECT_SHOW_SUBCLASS

#define OS_OBJECT_SHOW_SUBCLASS(name, super, ...) typedef super##_t name##_t

macroOS_OBJECT_GLOBAL_OBJECT

#define OS_OBJECT_GLOBAL_OBJECT(type, object) ((OS_OBJECT_BRIDGE type)&(object))

functionos_retain

API_AVAILABLE(macos(10.10), ios(8.0)) OS_EXPORT OS_SWIFT_UNAVAILABLE("Can't be used with ARC") void* os_retain(
	void *object
)
@function os_retain @abstract Increment the reference count of an os_object. @discussion On a platform with the modern Objective-C runtime this is exactly equivalent to sending the object the -[retain] message. @param object The object to retain. @result The retained object.

functionos_release

API_AVAILABLE(macos(10.10), ios(8.0)) OS_EXPORT void OS_SWIFT_UNAVAILABLE("Can't be used with ARC") os_release(
	void *object
)
@function os_release @abstract Decrement the reference count of a os_object. @discussion On a platform with the modern Objective-C runtime this is exactly equivalent to sending the object the -[release] message. @param object The object to release.