Differences From Artifact [a85051edf1]:
- File src/OFMutableArray.m — part of check-in [8892ae9fcc] at 2012-07-12 01:28:46 on branch trunk — Don't access isa directly. (user: js, size: 7118) [annotate] [blame] [check-ins using]
To Artifact [b2cd72f318]:
- File
src/OFMutableArray.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: 7108) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
18 19 20 21 22 23 24 | #include <string.h> #include <assert.h> #import "OFMutableArray.h" #import "OFMutableArray_adjacent.h" | < > | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #include <string.h> #include <assert.h> #import "OFMutableArray.h" #import "OFMutableArray_adjacent.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" static struct { Class isa; } placeholder; @interface OFMutableArray_placeholder: OFMutableArray |
︙ | ︙ | |||
196 197 198 199 200 201 202 | @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void)insertObjectsFromArray: (OFArray*)array atIndex: (size_t)index { | | | | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void)insertObjectsFromArray: (OFArray*)array atIndex: (size_t)index { void *pool = objc_autoreleasePoolPush(); OFEnumerator *enumerator = [array objectEnumerator]; size_t i, count = [array count]; for (i = 0; i < count; i++) { id object = [enumerator nextObject]; assert(object != nil); [self insertObject: object atIndex: index + i]; } objc_autoreleasePoolPop(pool); } - (void)replaceObjectAtIndex: (size_t)index withObject: (id)object { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; |
︙ | ︙ |