You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@wandisco.com> on 2015/06/06 15:47:58 UTC

Re: svn commit: r1683895 - /subversion/trunk/subversion/libsvn_delta/svndiff.c

On 06.06.2015 13:42, ivan@apache.org wrote:
> Author: ivan
> Date: Sat Jun  6 11:42:31 2015
> New Revision: 1683895
>
> URL: http://svn.apache.org/r1683895
> Log:
> Simplify code and avoid multiple buffer reallocation for every delta
> window in SVNDIFF stream processing.
>
> * subversion/libsvn_delta/svndiff.c
>   (write_handler): Use svn_stringbuf_remove() to remove processed 
>    window data from buffer. Clear subpool on every window procesing 
>    instead of creating new subpool and destroy old one.
>   (svn_txdelta_parse_svndiff): Allocate DB->BUFFER in DB->POOL instead of
>    DB->SUBPOOL.

If you're optimizing that code, you could consider dropping
svn_stringbuf_t entirely and switching to (private) svn_membuf_t. The
advantage of that is that stringbuf always keeps a NUL terminator at the
end of the data, whereas membuf does not.

-- Brane