Displaying 19 results from an estimated 19 matches for "thestream".
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...ember 2009 13:53, David Greene wrote:
> > > > + 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
> > &g...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...vid Greene wrote:
> > > > > + 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);
> > > >...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 13:53, David Greene wrote:
> > > + 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->SetU...
2009 Dec 18
4
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...buffering 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 zer...
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...lic:
+ /// DELETE_STREAM - Tell the destructor to delete the held stream.
+ ///
+ static const bool DELETE_STREAM = true;
+
+ /// PRESERVE_STREAM - Tell the destructor 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 - T...
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...lic:
+ /// DELETE_STREAM - Tell the destructor to delete the held stream.
+ ///
+ static const bool DELETE_STREAM = true;
+
+ /// PRESERVE_STREAM - Tell the destructor 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 - T...
2009 Dec 21
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...m and is responsible for cleanup, memory management
+ /// issues, etc.
+ ///
+ static const bool TAKE_OWNERSHIP = true;
+
+ /// REFERENCE_ONLY - Tell this stream it should not manage the
+ /// held stream.
+ ///
+ static const bool REFERENCE_ONLY = 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;
+
+ /// OwnsStream - Are we responsible for managing the underlying
+ /// stream?
+ ///
+ bool OwnsStream;
+
+ /// BufferSize -...
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...rvation" 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 why you need to fiddle
> with the underlying buff...
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 16
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...erArray? Also, 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 tha...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...'t want another layer of buffering 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 wel...
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...st bool PRESERVE_STREAM = false;
I don't find these to be very clear names. How about giving them a
name involving 'ownership' like TAKES_OWNERSHIP? "preservation" isn't
really the same as "not deleting when the stream is destroyed" to me.
> + /// 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 why you need to fiddle
with the underlying buffering of TheStream. In the...
2009 Dec 21
3
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...e naming here is poor. I'll fix that.
>
> Here's the next iteration.
Gentle reminder, please include patches as attachments, it makes them easier to review.
>> Now that I understand the model :) I don't see why you need to fiddle
>> with the underlying buffering of TheStream. In the dbgs() use case,
>> the underlying stream will be errs() which is already unbuffered.
>
> Might circular_raw_ostream be used with other streams at some point?
In that case, setting the underlying stream to unbuffered seems even more dangerous. The client who sets up the bu...
2009 Dec 21
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Monday 21 December 2009 13:40, Chris Lattner wrote:
> >> Now that I understand the model :) I don't see why you need to fiddle
> >> with the underlying buffering of TheStream. In the dbgs() use case,
> >> the underlying stream will be errs() which is already unbuffered.
> >
> > Might circular_raw_ostream be used with other streams at some point?
>
> In that case, setting the underlying stream to unbuffered seems even more
> dangerous. T...
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
2007 Feb 09
1
speex in C# please help
...ic const int Speex_Get_Frame_Size = 3;
public const int Speex_Set_Quality = 4;
public const int Speex_nb_Mode = 3;
//create the structure that will hold the speexbits
public struct SpeexBits
{
public char *chars; /* "raw" data */
public int nbBits; /* Total number of bits stored in thestream*/
public int charPtr; /* Position of the byte "cursor" */
public int bitPtr; /* Position of the bit "cursor" within thecurrent char */
public int owner; /* Does the struct "own" the "raw" buffer(member "chars") */
public int overflow; /* Set to...
2008 Jul 30
1
Speex in VB .NET
...'create the structure that will hold the speexbits <StructLayout(LayoutKind.Sequential)> _ Public Structure SpeexBits Public chars As IntPtr ' "raw" data Public nbBits As Integer ' Total number of bits stored in thestream Public charPtr As Integer ' Position of the byte "cursor" Public bitPtr As Integer ' Position of the bit "cursor" within thecurrent char Public owner As Integer ' Does the struct "own" the...
2007 Feb 13
1
Re: Speex-dev Digest, Vol 33, Issue 10
...nt Speex_Set_Quality = 4;
>
> public const int Speex_nb_Mode = 3;
>
> //create the structure that will hold the speexbits
>
> public struct SpeexBits
>
> {
>
> public char *chars; /* "raw" data */
>
> public int nbBits; /* Total number of bits stored in thestream*/
>
> public int charPtr; /* Position of the byte "cursor" */
>
> public int bitPtr; /* Position of the bit "cursor" within thecurrent char */
>
> public int owner; /* Does the struct "own" the "raw" buffer(member "chars") */
>...