Differences From Artifact [20a79e42c1]:
- File
src/OFData.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: 14753) [annotate] [blame] [check-ins using]
To Artifact [f4f38100bd]:
- File src/OFData.m — part of check-in [1a70abc65d] at 2020-11-06 01:11:51 on branch trunk — OF*Data: Avoid -[allocMemoryWithSize:] (user: js, size: 14754) [annotate] [blame] [check-ins using]
︙ | |||
129 130 131 132 133 134 135 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - + - + | { self = [super init]; @try { if (itemSize == 0) @throw [OFInvalidArgumentException exception]; |
︙ | |||
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | 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 | + - - + | exceptionWithURL: URL]; stream = [URLHandler openItemAtURL: URL mode: @"r"]; _itemSize = 1; _count = 0; _freeWhenDone = true; pageSize = [OFSystemInfo pageSize]; buffer = of_malloc(1, pageSize); @try { while (!stream.atEndOfStream) { size_t length = [stream readIntoBuffer: buffer length: pageSize]; if (SIZE_MAX - _count < length) @throw [OFOutOfRangeException exception]; |
︙ | |||
288 289 290 291 292 293 294 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | - + + | const char *cString; if (count % 2 != 0) @throw [OFInvalidFormatException exception]; count /= 2; |
︙ |