#include #include #include #include #include @implementation PXObject + (instancetype)alloc { return class_createInstance(self, 0); } #ifdef PARADOX_DEBUG_FEATURES + (instancetype)allocDebug { printf("alloc: self = %p\n", (void*)self); printf("alloc: instance size = %zu\n", class_getInstanceSize(self)); printf("alloc: sizeof(Class) = %zu\n", sizeof(Class)); id object = [self alloc]; printf("alloc: object = %p\n", (void*)object); return object; } #endif + (instancetype) new { return [[self alloc] init]; } - (instancetype) retain { return objc_retain_fast_np(self); } - (void) release { objc_release_fast_np(self); } - (instancetype) autorelease { return objc_autorelease(self); } - (instancetype)init { return self; } - (void)dealloc { object_dispose(self); } #ifdef PARADOX_DEBUG_FEATURES - (void)healthCheck { printf("PXObject health check: %p\n", (void*)self); } #endif @end