Differences From Artifact [6230f1526a]:
- File
src/OFSet_hashtable.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: 5068) [annotate] [blame] [check-ins using]
To Artifact [246ec8ee26]:
- File src/OFSet_hashtable.m — part of check-in [c137da5e5b] at 2012-09-16 15:27:48 on branch trunk — Prefix all private methods with OF_. (user: js, size: 5062) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
57 58 59 60 61 62 63 | id object; /* * We can't just copy the dictionary as the specified set might * be a counted set, but we're just a normal set. */ while ((object = [enumerator nextObject]) != nil) | | | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | id object; /* * We can't just copy the dictionary as the specified set might * be a counted set, but we're just a normal set. */ while ((object = [enumerator nextObject]) != nil) [dictionary OF_setObject: one forKey: object copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } |
︙ | ︙ | |||
81 82 83 84 85 86 87 | @try { void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; id *objects = [array objects]; size_t i, count = [array count]; for (i = 0; i < count; i++) | | | | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | @try { void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; id *objects = [array objects]; size_t i, count = [array count]; for (i = 0; i < count; i++) [dictionary OF_setObject: one forKey: objects[i] copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } |
︙ | ︙ | |||
105 106 107 108 109 110 111 | @try { void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; size_t i; for (i = 0; i < count; i++) | | | | | | | | | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | @try { void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; size_t i; for (i = 0; i < count; i++) [dictionary OF_setObject: one forKey: objects[i] copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } return self; } - initWithObject: (id)firstObject arguments: (va_list)arguments { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; id object; [dictionary OF_setObject: one forKey: firstObject copyKey: NO]; while ((object = va_arg(arguments, id)) != nil) [dictionary OF_setObject: one forKey: object copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } |
︙ | ︙ | |||
170 171 172 173 174 175 176 | one = [OFNumber numberWithSize: 1]; enumerator = [[element elementsForNamespace: OF_SERIALIZATION_NS] objectEnumerator]; while ((child = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); | | | | | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | one = [OFNumber numberWithSize: 1]; enumerator = [[element elementsForNamespace: OF_SERIALIZATION_NS] objectEnumerator]; while ((child = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); [dictionary OF_setObject: one forKey: [child objectByDeserializing] copyKey: NO]; objc_autoreleasePoolPop(pool2); } objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; |
︙ | ︙ |