Re: Continuously concatenating binary data

From: K_Lee (Google_Post_at_slink-software.com)
Date: 10/16/03


Date: 16 Oct 2003 11:36:55 -0700

Just a thought:

If your user have small amount of memory or record large
amount of data, all your malloc/realloc will turn into
swap disk i/o.

It would be no differents than stream approach.
In fact stream give you better control on amount of memory
your app needs.

--
The source is out there.  Browse and document open/share source 
projects such as Apache, Tcl, Ethereal, Mozilla, .Net SSCLI.
http://www.slink-software.com
"Victor Bazarov" <v.Abazarov@attAbi.com> wrote in message news:<J2yjb.292805$mp.232723@rwcrnsc51.ops.asp.att.net>...
> "Unforgiven" <jaapd3000@hotmail.com> wrote...
> > I have an application, where I continuously get new binary data input, in
> > the form of a char*. This data comes from the Windows Multimedia wave
>  input
> > functions, but that's not important. What it means is that every 2
>  seconds,
> > I need to add 22050 bytes to an ever expanding buffer. I have no idea at
>  the
> > beginning how large this buffer would need to be.
> 
> What do you need the buffer for?  Do you use it right away?  Does
> the buffer have to be contiguous during your input?
> 
> If not, use a list<your22050bytes>.  I suspect that even if you do
> need to use the "stream" right away, the list is quick enough for
> all your streaming needs.
> 
> > [...]
> 
> Victor


Relevant Pages

  • An excellent explanation
    ... I always enjoy your responses since your technical knowledge of the product ... >> when watching Live TV however if the OS has not yet reused the memory ... >> since it tries to keep a couple of minutes of the buffer in memory you ... That's why the Stream ...
    (microsoft.public.windows.mediacenter)
  • Re: ReadFile and Buffersize
    ... Imagine what happens if the buffer size is ... imagine that the maximal amount of memory the ... memory, necessary for reading a second megabyte from the file, write it ...
    (microsoft.public.win32.programmer.kernel)
  • Re: MemoryStream Error After Many Writes
    ... >> I have set the initial stream Size to 1Mb and increased the size by 1Mb ... >> big enough block of memory. ... >You could always use a large circular buffer and a writer thread. ... >but it would probably result in a more long lived app. ...
    (comp.lang.pascal.delphi.misc)
  • Cool example with memory streams and binary writer/reader
    ... With streams (memory streams) and binary reader and binary writer. ... mReceiveStream: Stream; ... SetLength(mReceiveBuffer, 2000); ... // read the buffer into the stream, offset 0, length 7 ...
    (alt.comp.lang.borland-delphi)
  • Re: proms 320kbps
    ... The R3 320k stream was a live stream, ... As for the buffer size on the live streams, ... connection such as Jim's, the amount is inadequate. ...
    (uk.rec.audio)