Differences From Artifact [a1c992248d]:
- File
src/OFArray.m
— part of check-in
[a2b4238850]
at
2020-11-06 02:24:14
on branch trunk
— Future-proof some code using freeWhenDone
While -[OFData initWithDataNoCopy:count:itemSize:freeWhenDone:] can
currently never throw, it might in the future, and when it does so in
the future, these would be memory leaks then. (user: js, size: 18215) [annotate] [blame] [check-ins using]
To Artifact [6e7407d49b]:
- File src/OFArray.m — part of check-in [7aa23887d0] at 2020-11-07 10:38:49 on branch trunk — Make GCC happy again (user: js, size: 18220) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
243 244 245 246 247 248 249 | size_t count = self.count; id *buffer = of_malloc(count, sizeof(id)); @try { [self getObjects: buffer inRange: of_range(0, count)]; | | | | | | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | size_t count = self.count; id *buffer = of_malloc(count, sizeof(id)); @try { [self getObjects: buffer inRange: of_range(0, count)]; return [[OFData dataWithItemsNoCopy: buffer count: count itemSize: sizeof(id) freeWhenDone: true] items]; } @catch (id e) { free(buffer); @throw e; } } - (id)copy |
︙ | ︙ |