82#if !defined(_SC_PAGESIZE)
123 clazz->
next = __sync_lock_test_and_set(&
_classes, clazz);
135 object->clazz = clazz;
136 object->referenceCount = 1;
138 ident interface = clazz->interface;
153 if (c == clazz || clazz ==
_Object()) {
170 if (strcmp(name, c->
def.
name) == 0) {
177 if (asprintf(&s,
"_%s", name) > 0) {
203 if (__sync_add_and_fetch(&object->referenceCount, -1) == 0) {
217 __sync_add_and_fetch(&object->referenceCount, 1);
ident _alloc(Class *clazz)
Instantiate a type through the given Class.
Class * classForName(const char *name)
ident _cast(Class *clazz, const ident obj)
Perform a type-checking cast.
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
Class * _initialize(const ClassDef *def)
Initializes the given Class.
ident retain(ident obj)
Atomically increment the given Object's reference count.
Classes describe the state and behavior of an Objectively type.
#define cast(type, obj)
Safely cast obj to type.
Object is the root Class of The Objectively Class hierarchy.
void * ident
The identity type, similar to Objective-C id.
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
size_t instanceSize
The instance size (required).
size_t interfaceSize
The interface size (required).
ptrdiff_t interfaceOffset
The interface offset (required).
Class * superclass
The superclass (required). e.g. _Object().
void(* destroy)(Class *clazz)
The Class destructor (optional). This method is run for initialized Classes when your application exi...
const char * name
The Class name (required).
void(* initialize)(Class *clazz)
The Class initializer (optional).
The runtime representation of a Class.
ClassDef def
The Class definition.
Class * next
Provides chaining of initialized Classes.
ident interface
The interface of the Class.
Object is the root Class of The Objectively Class hierarchy.
Class * _Object(void)
The Object archetype.
void dealloc(Object *self)
Frees all resources held by this Object.
Unicode next(StringReader *self)
void setup(URLSessionTask *)
Sets up this task.
void teardown(URLSessionTask *)
Tears down this task.