Differences From Artifact [3e396d5660]:
- File
src/OFStream.m
— part of check-in
[a7d66e7ab2]
at
2016-05-05 19:54:55
on branch trunk
— OFStream: Cache small reads to reduce syscalls
In some situations, this is 50x faster. (user: js, size: 31181) [annotate] [blame] [check-ins using]
To Artifact [b4ba3031a1]:
- File
src/OFStream.m
— part of check-in
[28fe0a104d]
at
2016-05-28 19:42:05
on branch trunk
— OFStream: Free the right variable
This was forgotten when adding the caching optimizations: It still tried
to free _readBuffer instead of _readBufferMemory, which failed as the
sanity checks noticed that _readBuffer is not the pointer that had been
allocated. (user: js, size: 31187) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
1527 1528 1529 1530 1531 1532 1533 | if (length > SIZE_MAX - _readBufferLength) @throw [OFOutOfRangeException exception]; readBuffer = [self allocMemoryWithSize: _readBufferLength + length]; memcpy(readBuffer, buffer, length); memcpy(readBuffer + length, _readBuffer, _readBufferLength); | | | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 | if (length > SIZE_MAX - _readBufferLength) @throw [OFOutOfRangeException exception]; readBuffer = [self allocMemoryWithSize: _readBufferLength + length]; memcpy(readBuffer, buffer, length); memcpy(readBuffer + length, _readBuffer, _readBufferLength); [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = readBuffer; _readBufferLength += length; } - (void)close { OF_UNRECOGNIZED_SELECTOR } @end |