Differences From Artifact [a6c8e71afe]:
- File src/OFArray_adjacent.m — part of check-in [8892ae9fcc] at 2012-07-12 01:28:46 on branch trunk — Don't access isa directly. (user: js, size: 6280) [annotate] [blame] [check-ins using]
To Artifact [9a07b7851a]:
- File
src/OFArray_adjacent.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: 6274) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
20 21 22 23 24 25 26 | #import "OFArray_adjacent.h" #import "OFMutableArray_adjacent.h" #import "OFArray_adjacentSubarray.h" #import "OFDataArray.h" #import "OFString.h" #import "OFXMLElement.h" | < > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #import "OFArray_adjacent.h" #import "OFMutableArray_adjacent.h" #import "OFArray_adjacentSubarray.h" #import "OFDataArray.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" @implementation OFArray_adjacent - init { self = [super init]; |
︙ | ︙ | |||
148 149 150 151 152 153 154 | } - initWithSerialization: (OFXMLElement*)element { self = [self init]; @try { | | < < < > > > | | | | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | } - initWithSerialization: (OFXMLElement*)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); OFEnumerator *enumerator; OFXMLElement *child; if ((![[element name] isEqual: @"OFArray"] && ![[element name] isEqual: @"OFMutableArray"]) || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; enumerator = [[element elementsForNamespace: OF_SERIALIZATION_NS] objectEnumerator]; while ((child = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); id object; object = [child objectByDeserializing]; [array addItem: &object]; [object retain]; objc_autoreleasePoolPop(pool2); } objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ |