@@ -59,14 +59,17 @@ void *protocols, *gc_object_type; long abi_version; void *ivar_offsets, *properties; }; +#ifndef OF_OBJFW_RUNTIME +/* ObjFW-RT already defines those */ enum objc_abi_class_info { OBJC_CLASS_INFO_CLASS = 0x01, OBJC_CLASS_INFO_METACLASS = 0x02 }; +#endif extern void __objc_exec_class(void*); /* Begin of ObjC module */ static struct objc_abi_metaclass _NSConcreteStackBlock_metaclass = { @@ -179,21 +182,15 @@ if (block->isa == (Class)&_NSConcreteMallocBlock) { #if defined(OF_ATOMIC_OPS) of_atomic_inc_int(&block->flags); #else -# ifdef OF_THREADS unsigned hash = SPINLOCK_HASH(block); assert(of_spinlock_lock(&spinlocks[hash])); -# endif - block->flags++; - -# ifdef OF_THREADS assert(of_spinlock_unlock(&spinlocks[hash])); -# endif #endif } return block; } @@ -212,30 +209,22 @@ block->descriptor->dispose_helper(block); free(block); } #else -# ifdef OF_THREADS unsigned hash = SPINLOCK_HASH(block); assert(of_spinlock_lock(&spinlocks[hash])); -# endif - if ((--block->flags & OF_BLOCK_REFCOUNT_MASK) == 0) { -# ifdef OF_THREADS assert(of_spinlock_unlock(&spinlocks[hash])); -# endif if (block->flags & OF_BLOCK_HAS_COPY_DISPOSE) block->descriptor->dispose_helper(block); free(block); } - -# ifdef OF_THREADS assert(of_spinlock_unlock(&spinlocks[hash])); -# endif #endif } void _Block_object_assign(void *dst_, const void *src_, const int flags_) @@ -333,11 +322,11 @@ free(tmp); objc_registerClassPair((Class)&_NSConcreteMallocBlock); } #endif -#if !defined(OF_ATOMIC_OPS) && defined(OF_THREADS) +#if !defined(OF_ATOMIC_OPS) + (void)initialize { size_t i; for (i = 0; i < NUM_SPINLOCKS; i++)