search for: deletestream

Displaying 13 results from an estimated 13 matches for "deletestream".

2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...am() { > > > > + // Delete the stream if needed. Otherwise, transfer the buffer > > > > + // settings from this raw_ostream back to the underlying > > > > stream. + if (!TheStream) > > > > + return; > > > > + if (DeleteStream) > > > > + delete TheStream; > > > > + else if (BufferSize > 0) > > > > + TheStream->SetBufferSize(BufferSize); > > > > + else > > > > + TheStream->SetUnbuffered(); > > > > > > Anot...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...; > + // Delete the stream if needed. Otherwise, transfer the > > > > > buffer + // settings from this raw_ostream back to the > > > > > underlying stream. + if (!TheStream) > > > > > + return; > > > > > + if (DeleteStream) > > > > > + delete TheStream; > > > > > + else if (BufferSize > 0) > > > > > + TheStream->SetBufferSize(BufferSize); > > > > > + else > > > > > + TheStream->SetUnbuffered(); > >...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...gt; + void releaseStream() { > > > + // Delete the stream if needed. Otherwise, transfer the buffer > > > + // settings from this raw_ostream back to the underlying stream. > > > + if (!TheStream) > > > + return; > > > + if (DeleteStream) > > > + delete TheStream; > > > + else if (BufferSize > 0) > > > + TheStream->SetBufferSize(BufferSize); > > > + else > > > + TheStream->SetUnbuffered(); > > Another issue is that this is transfering the cir...
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...or to not delete the held + /// stream. + /// + static const bool PRESERVE_STREAM = false; + + private: + /// TheStream - The real stream we output to. We set it to be + /// unbuffered, since we're already doing our own buffering. + /// + raw_ostream *TheStream; + + /// DeleteStream - Do we need to delete TheStream in the + /// destructor? + /// + bool DeleteStream; + + /// BufferSize - The size of the buffer in bytes. + /// + unsigned BufferSize; + /// BufferArray - The actual buffer storage. + /// + char *BufferArray; + + /// Cur - Pointer to th...
2009 Dec 18
4
[LLVMdev] [PATCH] Circular Buffered Debug Stream
.../// underneath it. > > + /// > > + circular_raw_ostream(raw_ostream &Stream, unsigned BuffSize = 8192, > > + bool Delete = false) > > + : raw_ostream(/*unbuffered*/true), > > + TheStream(0), > > + DeleteStream(PRESERVE_STREAM), > > + BufferSize(BuffSize), > > + BufferArray(0) { > > + if (BufferSize > 0) > > + BufferArray = new char[BufferSize]; > > How about just asserting that BufferSize is not zero? This stream won't > work well...
2009 Dec 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
..., why is it signed? What does DelayOutput do? Even reading the code, I don't really understand what it is doing. + circular_raw_ostream(raw_ostream &Stream, int BufferSize = -1, + bool Delete = false) + : raw_ostream(/*unbuffered*/true), TheStream(0), DeleteStream(false), + BufferArray(BufferSize < 0 ? 8192 : BufferSize), Please make BufferSize an 'unsigned' and default it to 8192. Please use PRESERVE_STREAM instead of 'false'. > Do you want another patch that modifies Debug.h and then one more patch that > shows clie...
2009 Dec 16
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Wednesday 16 December 2009 13:19, Chris Lattner wrote: > + int BufferSize; > + std::vector<char> BufferArray; > + bool DelayOutput; > + std::vector<char>::iterator Cur; > > Please doxygenify these. Ok. > Instead of using a std::vector for BufferArray, please just new[] an array > since it is fixed size. Ok. > Why is BufferSize needed with
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...or to not delete the held + /// stream. + /// + static const bool PRESERVE_STREAM = false; + + private: + /// TheStream - The real stream we output to. We set it to be + /// unbuffered, since we're already doing our own buffering. + /// + raw_ostream *TheStream; + + /// DeleteStream - Do we need to delete TheStream in the + /// destructor? + /// + bool DeleteStream; + + /// BufferSize - The size of the buffer in bytes. + /// + size_t BufferSize; + + /// BufferArray - The actual buffer storage. + /// + char *BufferArray; + + /// Cur - Pointer to th...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...fering to be happening > + /// underneath it. > + /// > + circular_raw_ostream(raw_ostream &Stream, unsigned BuffSize = 8192, > + bool Delete = false) > + : raw_ostream(/*unbuffered*/true), > + TheStream(0), > + DeleteStream(PRESERVE_STREAM), > + BufferSize(BuffSize), > + BufferArray(0) { > + if (BufferSize > 0) > + BufferArray = new char[BufferSize]; How about just asserting that BufferSize is not zero? This stream won't work well and doesn't make sense with a...
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
..., and change it to not use 'false' as I asked for before. > + circular_raw_ostream(raw_ostream &Stream, size_t BuffSize = 8192, > + bool Delete = false) > + : raw_ostream(/*unbuffered*/true), > + TheStream(0), > + DeleteStream(PRESERVE_STREAM), > + BufferSize(BuffSize), > + BufferArray(0) { > + if (BufferSize > 0) Please change all these predicates to BufferSize != 0 instead of using >. > + > +#include "llvm/Support/circular_raw_ostream.h" > + > +#inclu...
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...g 'ownership' like TAKES_OWNERSHIP? "preservation" isn't > really the same as "not deleting when the stream is destroyed" to me. That's a good idea. I just took these from what Dan (I think) did in formatted_raw_ostream. I'll change them here and rename DeleteStream to OwnsStream as well. > > + /// TheStream - The real stream we output to. We set it to be > > + /// unbuffered, since we're already doing our own buffering. > > + /// > > + raw_ostream *TheStream; > > Now that I understand the model :) I don't see...
2009 Dec 16
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Tuesday 15 December 2009 23:02, Chris Lattner wrote: > On Dec 15, 2009, at 6:33 PM, David Greene wrote: > > On Tuesday 15 December 2009 20:11, Chris Lattner wrote: > >> Please send complete and minimal patches to avoid wasting reviewer's > >> time, > > > > What do you want, complete or minimal? I don't want to pre-send 50 > > or so patches
2009 Dec 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 15, 2009, at 6:33 PM, David Greene wrote: > On Tuesday 15 December 2009 20:11, Chris Lattner wrote: > >> Please send complete and minimal patches to avoid wasting reviewer's >> time, > > What do you want, complete or minimal? I don't want to pre-send 50 > or so patches (one per source file) that simply change errs() to dbgs(). > Thus I thought I