[PATCH] D47170: [fuchsia] Add line buffering in RawWrite
Roland McGrath via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 22 16:43:08 PDT 2018
mcgrathr added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc:419
+ lastNewline = line;
+ __sanitizer_log_write(line, lastNewline - line);
+ internal_memmove(line, lastNewline, line + size - lastNewline);
----------------
if lastNewline was null now it's line and so this writes a count of 0.
Seems like the code would be simpler if lastNewline were an index too.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc:428
+ }
+ // Flush if there's a newline in the buffer but the buffer isn't full.
+ // This prevents the last few lines from not being flushed.
----------------
This seems like an odd way to describe it. The behavior is just "Flush all complete lines before returning".
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D47170
More information about the llvm-commits
mailing list