@@ -27,20 +27,20 @@ #import "OFDate.h" #import "OFString.h" #import "OFDictionary.h" #import "OFXMLElement.h" -#import "OFAutoreleasePool.h" #ifdef OF_THREADS # import "OFThread.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" +#import "autorelease.h" #import "macros.h" #import "of_strptime.h" #if (!defined(HAVE_GMTIME_R) || !defined(HAVE_LOCALTIME_R)) && \ defined(OF_THREADS) @@ -320,11 +320,11 @@ - initWithSerialization: (OFXMLElement*)element { self = [super init]; @try { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); union { double d; uint64_t u; } d; @@ -335,11 +335,11 @@ selector: _cmd]; d.u = (uint64_t)[element hexadecimalValue]; seconds = of_bswap_double_if_le(d.d); - [pool release]; + objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } @@ -411,11 +411,11 @@ return [self dateStringWithFormat: @"%Y-%m-%dT%H:%M:%SZ"]; } - (OFXMLElement*)XMLElementBySerializing { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; union { double d; uint64_t u; } d; @@ -426,14 +426,14 @@ d.d = of_bswap_double_if_le(seconds); [element setStringValue: [OFString stringWithFormat: @"%016" PRIx64, d.u]]; [element retain]; - [pool release]; - [element autorelease]; + + objc_autoreleasePoolPop(pool); - return element; + return [element autorelease]; } - (uint32_t)microsecond { return (uint32_t)rint((seconds - floor(seconds)) * 1000000);