forked from ccache/ccache
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read/write optimizations (ccache#551)
* Avoid one extra read call after the final bytes are read If read returns less then the requested number of bytes, the file is at EOF. This can be used in all places where a read is done, but it makes extra impact in read_file where if the buffer is made one byte bigger than needed, EOF can be detected before a unnecessary memory reallocation is done. * Use write instead of fwrite to write the result file This avoids the caching in stdio where a write is split into two (at least on my system): first a small 4k one and then one with the remaining 60k.
- Loading branch information
Showing
5 changed files
with
51 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters