@@ -29,11 +29,10 @@ #ifdef __QNX__ # include #endif #import "OFObject.h" -#import "OFAutoreleasePool.h" #import "OFAllocFailedException.h" #import "OFEnumerationMutationException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" @@ -40,10 +39,11 @@ #import "OFMemoryNotPartOfObjectException.h" #import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" +#import "autorelease.h" #import "macros.h" #if defined(OF_APPLE_RUNTIME) && __OBJC2__ # import #elif defined(OF_OBJFW_RUNTIME) @@ -84,11 +84,10 @@ #define PRE_MEM(mem) ((struct pre_mem*)(void*)((char*)mem - PRE_MEM_ALIGN)) static struct { Class isa; } alloc_failed_exception; -static Class autoreleasePool = Nil; static SEL cxx_construct = NULL; static SEL cxx_destruct = NULL; size_t of_pagesize; @@ -811,18 +810,11 @@ #endif } - autorelease { - /* - * Cache OFAutoreleasePool since class lookups are expensive with the - * GNU ABI used by GCC. - */ - if (autoreleasePool == Nil) - autoreleasePool = [OFAutoreleasePool class]; - - return [autoreleasePool addObject: self]; + return _objc_rootAutorelease(self); } - self { return self;