Hi Stefan,

Stefan Fuhrmann <stef...@apache.org> writes:

> Introduce a stream wrapper object that adds mark/seek support to any
> readable stream.  Use it on the stdin streams in our CL tools.

[...]

What happens if someone calls svn_stream_mark(stream, &mark, pool) on the
stream and then — perhaps, much later — reads a huge amount of data from the
stream?  Say, the total amount of data to read is 8 GiB, and it's processed in
small chunks.  Is it true that in this case all 8 GiB of data are going to be
buffered by the stream and kept in memory?

Here is an quick example:

 SVN_ERR(svn_stream_mark(buffered_stream, &mark, pool));
 ...

 while (!eof)
   {
     svn_stringbuf_t *str;

     svn_pool_clear(iterpool);

     SVN_ERR(svn_stream_readline(buffered_stream, &str, "\n", &eof, iterpool));
     ...
   }


Regards,
Evgeny Kotkov

Reply via email to