subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Kotkov <evgeny.kot...@visualsvn.com>
Subject Re: svn commit: r1698359 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/stream.c svnadmin/svnadmin.c svnfsfs/load-index-cmd.c tests/libsvn_subr/stream-test.c
Date Sat, 29 Aug 2015 14:57:45 GMT
Hi Stefan,

Stefan Fuhrmann <stefan2@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

Mime
View raw message