[PATCH] D39444: [Support] Make the default chunk size of raw_fd_ostream to 1 GiB.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 19:51:00 PDT 2017


ruiu added inline comments.


================
Comment at: llvm/lib/Support/raw_ostream.cpp:581
 
-#ifndef LLVM_ON_WIN32
-#if defined(__linux__)
-  bool ShouldWriteInChunks = true;
-#else
-  bool ShouldWriteInChunks = false;
-#endif
-#else
+  // It is observed that Linux returns EINVAL for a very large write (>2G),
+  // so the default write size is limited to 1 GiB.
----------------
krytarowski wrote:
> ruiu wrote:
> > krytarowski wrote:
> > > Am I looking correctly that we enforce Linux behavior to every UNIX?
> > Yes. Compared to writing 1 GiB data, the overhead of system call is negligible, so I kept it simple.
> Keeping it simple is fine, but I prompt to make this comment more aware of existence of other OSes... or even better just enable it on Linux, it might silently break others like Linux for >2GB.
Sure.


https://reviews.llvm.org/D39444





More information about the llvm-commits mailing list