@@ -17,14 +17,15 @@ #include "config.h" #import "OFNull.h" #import "OFString.h" #import "OFXMLElement.h" -#import "OFAutoreleasePool.h" #import "OFInvalidArgumentException.h" #import "OFNotImplementedException.h" + +#import "autorelease.h" static OFNull *null = nil; @implementation OFNull + null @@ -37,23 +38,23 @@ return null; } - initWithSerialization: (OFXMLElement*)element { - OFAutoreleasePool *pool; + void *pool; [self release]; - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; - [pool release]; + objc_autoreleasePoolPop(pool); return [OFNull null]; } - (OFString*)description @@ -66,21 +67,21 @@ return self; } - (OFXMLElement*)XMLElementBySerializing { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: [self className] namespace: OF_SERIALIZATION_NS]; [element retain]; - [pool release]; - [element autorelease]; + + objc_autoreleasePoolPop(pool); - return element; + return [element autorelease]; } - (OFString*)JSONRepresentation { return @"null";