@@ -162,11 +162,11 @@ # endif #endif static struct { Class isa; -} alloc_failed_exception; +} allocFailedException; #ifndef OF_HAVE_ATOMIC_OPS # define numSpinlocks 8 /* needs to be a power of 2 */ # define SPINLOCK_HASH(p) ((uintptr_t)p >> 4) & (numSpinlocks - 1) static OFSpinlock blockSpinlocks[numSpinlocks]; @@ -180,14 +180,13 @@ if ([(id)block isMemberOfClass: (Class)&_NSConcreteStackBlock]) { struct Block *copy; if ((copy = malloc(block->descriptor->size)) == NULL) { - alloc_failed_exception.isa = - [OFAllocFailedException class]; - @throw (OFAllocFailedException *) - &alloc_failed_exception; + object_setClass((id)&allocFailedException, + [OFAllocFailedException class]); + @throw (OFAllocFailedException *)&allocFailedException; } memcpy(copy, block, block->descriptor->size); object_setClass((id)copy, (Class)&_NSConcreteMallocBlock); copy->flags++; @@ -269,14 +268,14 @@ src = src->forwarding; if ((src->flags & OFBlockRefCountMask) == 0) { if ((*dst = malloc(src->size)) == NULL) { - alloc_failed_exception.isa = - [OFAllocFailedException class]; + object_setClass((id)&allocFailedException, + [OFAllocFailedException class]); @throw (OFAllocFailedException *) - &alloc_failed_exception; + &allocFailedException; } memcpy(*dst, src, src->size); (*dst)->flags = ((*dst)->flags & ~OFBlockRefCountMask) | 1;