[PATCH] Disable buffering for raw_null_ostream()

Mehdi AMINI mehdi.amini at apple.com
Tue Jun 30 22:40:56 PDT 2015


Hi rafael,

There is no need to buffer the nulls() output.
Moreover it kept a shared buffer, and made using nulls() not possible
in a multi-threaded environment.

http://reviews.llvm.org/D10861

Files:
  include/llvm/Support/raw_ostream.h

Index: include/llvm/Support/raw_ostream.h
===================================================================
--- include/llvm/Support/raw_ostream.h
+++ include/llvm/Support/raw_ostream.h
@@ -530,7 +530,7 @@
   uint64_t current_pos() const override;
 
 public:
-  explicit raw_null_ostream() {}
+  explicit raw_null_ostream() : raw_pwrite_stream(true) {}
   ~raw_null_ostream() override;
 };

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10861.28846.patch
Type: text/x-patch
Size: 394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150701/575c24ac/attachment.bin>


More information about the llvm-commits mailing list