Differences From Artifact [a0218b0933]:
- File src/OFXMLProcessingInstructions.m — part of check-in [8892ae9fcc] at 2012-07-12 01:28:46 on branch trunk — Don't access isa directly. (user: js, size: 3158) [annotate] [blame] [check-ins using]
To Artifact [00953e389a]:
- File
src/OFXMLProcessingInstructions.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 3149) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
17 18 19 20 21 22 23 | #include "config.h" #include <string.h> #import "OFXMLProcessingInstructions.h" #import "OFString.h" #import "OFXMLElement.h" | < > > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include "config.h" #include <string.h> #import "OFXMLProcessingInstructions.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" #import "autorelease.h" @implementation OFXMLProcessingInstructions + processingInstructionsWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } |
︙ | ︙ | |||
46 47 48 49 50 51 52 | } - initWithSerialization: (OFXMLElement*)element { self = [super init]; @try { | | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | } - initWithSerialization: (OFXMLElement*)element { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; processingInstructions = [[element stringValue] copy]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ |