On Mon, Sep 19, 2011 at 11:05, C. Michael Pilato <cmpilato_at_collab.net> wrote:
> Awesome. Wanna drop an exemplary use thereof into
> subversion/libsvn_repos/reporter.c (for use with the
> report_baton_t->tempfile member)? I've been wanting to make that change for
> some time now, and this would prove a good demonstration of your new logic.
I took a quick look at this, and some extra logic is going to be
needed. The reporter wants to read N bytes from the "buffer", but the
spillbuf says "you have N bytes $here [to consume]". The spillbuf also
works best when you write the same number of bytes as the declared
"blocksize". But if you declare a blocksize of 1000 bytes, and write
just 3, then you waste 997 bytes. And you're not allowed to write >
1000 (ie. split it up).
[ I need to put that info into the header ]
It seems the answer is a secondary layer that is more
byte/stream-oriented that will buffer writes to the blocksize (and do
splits), and then manages the read buffer to enable the byte/stream
style of reading.
I'd say that the key point is that the reporter is kind of
"record-oriented" while the spillbuf (as written) is a plain stream of
bytes that were collected a block at a time.
Received on 2011-09-20 17:07:42 CEST