<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Dec 16, 2009, at 8:12 AM, David Greene wrote:</div><blockquote type="cite"><div><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">What, specifically, do you want reviewed before I start checking in?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I'll be happy to prepare a patch that shows just that.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I want a patch that does one thing (e.g. implements dbgs(), <br></blockquote><br>Ok, let's start with that.  Here's the patch to add the circular raw_ostream.</div></blockquote><div><br></div><div>This idea of the patch makes sense to me, but here are a few questions:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+    int BufferSize;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+    std::vector<char> BufferArray;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+    bool DelayOutput;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+    std::vector<char>::iterator Cur;</div></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px; "><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">Please doxygenify these.</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><div>Instead of using a std::vector for BufferArray, please just new[] an array since it is fixed size.</div><div><br></div></span></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">Why is BufferSize needed with the vector? Isn't it always the size of BufferArray?  Also, why is it signed?</span></font></div></div><div><br></div><div><br></div><div>What does <span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">DelayOutput do?  Even reading the code, I don't really understand what it is doing.</span></div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+    circular_raw_ostream(raw_ostream &Stream, int BufferSize = -1,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+                         bool Delete = false) </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+        : raw_ostream(/*unbuffered*/true), TheStream(0), DeleteStream(false),</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+            BufferArray(BufferSize < 0 ? 8192 : BufferSize),</div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px; "><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">Please make BufferSize an 'unsigned' and default it to 8192.  Please use PRESERVE_STREAM instead of 'false'.</span></font></div></div><div><br></div><div><br></div><br><blockquote type="cite"><div>Do you want another patch that modifies Debug.h and then one more patch that<br>shows client use?<br></div></blockquote></div><br><div>Sure, you don't need to convert everything over, but once the general approach looks fine you can do the rest without review.</div><div><br></div><div>-Chris</div></body></html>