@@ -386,30 +386,10 @@ - (instancetype)init { OF_INVALID_INIT_METHOD } -#if defined(OF_OBJFW_RUNTIME) -- (instancetype)of_initWithIVar: (struct objc_ivar *)iVar -{ - self = [super init]; - - @try { - if (iVar->name != NULL) - _name = [[OFString alloc] - initWithUTF8String: iVar->name]; - - _typeEncoding = iVar->typeEncoding; - _offset = iVar->offset; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} -#elif defined(OF_APPLE_RUNTIME) - (instancetype)of_initWithIVar: (Ivar)iVar { self = [super init]; @try { @@ -425,13 +405,10 @@ @throw e; } return self; } -#else -# error Invalid ObjC runtime! -#endif - (void)dealloc { [_name release]; @@ -469,13 +446,13 @@ struct objc_method_list *methodList; struct objc_property_list *propertyList; #elif defined(OF_APPLE_RUNTIME) Method *methodList; objc_property_t *propertyList; +#endif Ivar *iVarList; unsigned count; -#endif void *pool; _classMethods = [[OFMutableArray alloc] init]; _instanceMethods = [[OFMutableArray alloc] init]; _properties = [[OFMutableArray alloc] init]; @@ -513,22 +490,10 @@ for (unsigned int i = 0; i < propertyList->count; i++) [_properties addObject: [[[OFProperty alloc] of_initWithProperty: &propertyList->properties[i]] autorelease]]; - objc_autoreleasePoolPop(pool); - } - - if (class->iVars != NULL) { - pool = objc_autoreleasePoolPush(); - - for (unsigned int i = 0; i < class->iVars->count; i++) - [_instanceVariables addObject: - [[[OFInstanceVariable alloc] - of_initWithIVar: - &class->iVars->iVars[i]] autorelease]]; - objc_autoreleasePoolPop(pool); } #elif defined(OF_APPLE_RUNTIME) methodList = class_copyMethodList(object_getClass(class), &count); @@ -570,10 +535,13 @@ objc_autoreleasePoolPop(pool); } @finally { free(propertyList); } +#else +# error Invalid ObjC runtime! +#endif iVarList = class_copyIvarList(class, &count); @try { pool = objc_autoreleasePoolPush(); @@ -584,13 +552,10 @@ objc_autoreleasePoolPop(pool); } @finally { free(iVarList); } -#else -# error Invalid ObjC runtime! -#endif [_classMethods makeImmutable]; [_instanceMethods makeImmutable]; [_properties makeImmutable]; [_instanceVariables makeImmutable];