@@ -18,12 +18,10 @@ #include #include #include -#include - #if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__) # import #elif defined(OF_OBJFW_RUNTIME) # import "runtime-private.h" #endif @@ -32,10 +30,11 @@ #import "OFAllocFailedException.h" #import "OFInitializationFailedException.h" #import "OFNotImplementedException.h" +#import "macros.h" #ifdef OF_ATOMIC_OPS # import "atomic.h" #endif #ifdef OF_THREADS # import "threading.h" @@ -199,13 +198,13 @@ #if defined(OF_ATOMIC_OPS) of_atomic_inc_int(&block->flags); #else unsigned hash = SPINLOCK_HASH(block); - assert(of_spinlock_lock(&spinlocks[hash])); + OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); block->flags++; - assert(of_spinlock_unlock(&spinlocks[hash])); + OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); #endif } return block; } @@ -226,22 +225,22 @@ free(block); } #else unsigned hash = SPINLOCK_HASH(block); - assert(of_spinlock_lock(&spinlocks[hash])); + OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); if ((--block->flags & OF_BLOCK_REFCOUNT_MASK) == 0) { - assert(of_spinlock_unlock(&spinlocks[hash])); + OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); if (block->flags & OF_BLOCK_HAS_COPY_DISPOSE) block->descriptor->dispose_helper(block); free(block); return; } - assert(of_spinlock_unlock(&spinlocks[hash])); + OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); #endif } void _Block_object_assign(void *dst_, const void *src_, const int flags_)