[libc-commits] [PATCH] D126829: [libc] add buffering to FILE writes
Michael Jones via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Jun 9 16:06:22 PDT 2022
michaelrj marked an inline comment as done.
michaelrj added inline comments.
================
Comment at: libc/src/__support/File/file.cpp:54
+ if (written < len)
+ err = true;
+ return written;
----------------
sivachandra wrote:
> You should have an `else` which does `platfrom_flush()`?
I have the flush outside of the unbuffered write so that in the fully buffered function (line 63) we can use the unbuffered write when the data is too large for the buffer. This means that in the base `write_unlocked` function and in `write_unlocked_lbf` we have to flush separately, but I think that's okay.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126829/new/
https://reviews.llvm.org/D126829
More information about the libc-commits
mailing list