Differences From Artifact [fb38385e6c]:
- File
src/OFMutableArray_adjacent.m
— part of check-in
[f173477bef]
at
2011-09-19 16:34:04
on branch trunk
— Rename -[allocMemoryForNItems:withSize:] and friends.
It is now -[allocMemoryForNItems:ofSize:]. (user: js, size: 5722) [annotate] [blame] [check-ins using]
To Artifact [cacb4ce363]:
- File
src/OFMutableArray_adjacent.m
— part of check-in
[e1e7ffa903]
at
2011-09-22 23:25:42
on branch trunk
— Exceptions are now autoreleased.
This is safe as an "exception loop" can't happen, since if allocating
an exception fails, it throws an OFAllocFailedException which is
preallocated and can always be thrown.So, the worst case would be that an autorelease of an exception fails,
triggering an OFOutOfMemoryException for which there is no memory,
resulting in an OFAllocFailedException to be thrown. (user: js, size: 5759) [annotate] [blame] [check-ins using]
︙ | |||
72 73 74 75 76 77 78 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - + | - (void)replaceObjectAtIndex: (size_t)index withObject: (id)object { id *cArray = [array cArray]; id oldObject; if (index >= [array count]) |
︙ | |||
147 148 149 150 151 152 153 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | - + | - (void)removeNObjects: (size_t)nObjects { id *cArray = [array cArray], *copy; size_t i, count = [array count]; if (nObjects > count) |
︙ | |||
170 171 172 173 174 175 176 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - + | - (void)removeObjectsInRange: (of_range_t)range { id *cArray = [array cArray], *copy; size_t i, count = [array count]; if (range.length > count - range.start) |
︙ | |||
233 234 235 236 237 238 239 | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - - + + - - + + - - + + + | size_t i, count = [array count]; BOOL stop = NO; unsigned long mutations2 = mutations; for (i = 0; i < count && !stop; i++) { if (mutations != mutations2) @throw [OFEnumerationMutationException |