@@ -174,30 +174,30 @@ void* _Block_copy(const void *block_) { of_block_literal_t *block = (of_block_literal_t*)block_; - if (block->isa == (Class)&_NSConcreteStackBlock) { + if (object_getClass((id)block) == (Class)&_NSConcreteStackBlock) { of_block_literal_t *copy; if ((copy = malloc(block->descriptor->size)) == NULL) { - alloc_failed_exception.isa = - [OFAllocFailedException class]; + object_setClass((id)&alloc_failed_exception, + [OFAllocFailedException class]); @throw (OFAllocFailedException*)&alloc_failed_exception; } memcpy(copy, block, block->descriptor->size); - copy->isa = (Class)&_NSConcreteMallocBlock; + object_setClass((id)copy, (Class)&_NSConcreteMallocBlock); copy->flags++; if (block->flags & OF_BLOCK_HAS_COPY_DISPOSE) block->descriptor->copy_helper(copy, block); return copy; } - if (block->isa == (Class)&_NSConcreteMallocBlock) { + if (object_getClass((id)block) == (Class)&_NSConcreteMallocBlock) { #if defined(OF_ATOMIC_OPS) of_atomic_inc_int(&block->flags); #else unsigned hash = SPINLOCK_HASH(block); @@ -213,11 +213,11 @@ void _Block_release(const void *block_) { of_block_literal_t *block = (of_block_literal_t*)block_; - if (block->isa != (Class)&_NSConcreteMallocBlock) + if (object_getClass((id)block) != (Class)&_NSConcreteMallocBlock) return; #ifdef OF_ATOMIC_OPS if ((of_atomic_dec_int(&block->flags) & OF_BLOCK_REFCOUNT_MASK) == 0) { if (block->flags & OF_BLOCK_HAS_COPY_DISPOSE) @@ -266,12 +266,12 @@ of_block_byref_t *src = (of_block_byref_t*)src_; of_block_byref_t **dst = (of_block_byref_t**)dst_; if ((src->flags & OF_BLOCK_REFCOUNT_MASK) == 0) { if ((*dst = malloc(src->size)) == NULL) { - alloc_failed_exception.isa = - [OFAllocFailedException class]; + object_setClass((id)&alloc_failed_exception, + [OFAllocFailedException class]); @throw (OFAllocFailedException*) &alloc_failed_exception; } if (src->forwarding == src) @@ -374,51 +374,51 @@ selector: _cmd]; } - init { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void*)allocMemoryWithSize: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void*)allocMemoryWithSize: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void*)resizeMemory: (void*)ptr size: (size_t)size { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void*)resizeMemory: (void*)ptr size: (size_t)size count: (size_t)count { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void)freeMemory: (void*)ptr { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - retain { - if (isa == (Class)&_NSConcreteMallocBlock) + if (object_getClass(self) == (Class)&_NSConcreteMallocBlock) return Block_copy(self); return self; } @@ -427,34 +427,34 @@ return Block_copy(self); } - autorelease { - if (isa == (Class)&_NSConcreteMallocBlock) + if (object_getClass(self) == (Class)&_NSConcreteMallocBlock) return [super autorelease]; return self; } - (unsigned int)retainCount { - if (isa == (Class)&_NSConcreteMallocBlock) + if (object_getClass(self) == (Class)&_NSConcreteMallocBlock) return ((of_block_literal_t*)self)->flags & OF_BLOCK_REFCOUNT_MASK; return OF_RETAIN_COUNT_MAX; } - (void)release { - if (isa == (Class)&_NSConcreteMallocBlock) + if (object_getClass(self) == (Class)&_NSConcreteMallocBlock) Block_release(self); } - (void)dealloc { - @throw [OFNotImplementedException exceptionWithClass: isa + @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; [super dealloc]; /* Get rid of a stupid warning */ } @end