Differences From Artifact [e881543a8d]:
- File
src/OFArray.m
— part of check-in
[0ddaac3f5b]
at
2020-11-05 00:24:29
on branch trunk
— Avoid -[allocMemoryWithSize:] for temporary memory
-[allocMemoryWithSize:] has book keeping overhead that is unnecessary
for temporary memory. (user: js, size: 18170) [annotate] [blame] [check-ins using]
To Artifact [eac8a2ce35]:
- File src/OFArray.m — part of check-in [da1fb6b21c] at 2020-11-05 02:27:35 on branch trunk — Further reduce usage of -[allocMemoryWithSize:] (user: js, size: 18164) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
236 237 238 239 240 241 242 |
{
for (size_t i = 0; i < range.length; i++)
buffer[i] = [self objectAtIndex: range.location + i];
}
- (id const *)objects
{
| < | > > < < < | | | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
{
for (size_t i = 0; i < range.length; i++)
buffer[i] = [self objectAtIndex: range.location + i];
}
- (id const *)objects
{
size_t count = self.count;
OFMutableData *data = [OFMutableData dataWithItemSize: sizeof(id)
capacity: count];
id *buffer;
[data increaseCountBy: count];
buffer = data.mutableItems;
[self getObjects: buffer
inRange: of_range(0, count)];
return buffer;
}
- (id)copy
|
| ︙ | ︙ |