[compiler-rt] r181924 - Try to improve performance by using a read/write buffer instead of I/O.

Bill Wendling isanbard at gmail.com
Thu May 16 11:01:56 PDT 2013


On May 16, 2013, at 9:22 AM, Reid Kleckner <rnk at google.com> wrote:

> -static uint64_t write_from_buffer(uint64_t *buffer, size_t size) {
> -  if (fwrite(buffer, 8, size, output_file) != size)
> -    return (uint64_t)-1;
> +static void write_bytes(const char *s, size_t len) {
> +  if (cur_offset + len > WRITE_BUFFER_SIZE)
> +    flush_buffer();
> 
> Can len be > WRITE_BUFFER_SIZE? 
> 
In theory, yes. But that would involve a filename that is > 1^12 characters long. That's such an edge case that I don't think we really need to worry about it...

-bw





More information about the llvm-commits mailing list