Stefan, the point of that debug code was to prevent anything from later modifying the original svn_stringbuf_t object, because that could change or invalidate the memory pointed to by the new svn_string_t alias.
- Julian
> Author: stefan2
> Date: Wed Mar 27 19:45:25 2013
> New Revision: 1461823
>
> URL: http://svn.apache.org/r1461823
> Log:
> On the fsfs-format7 branch: Allow svn_stringbuf_ts to be only
> temporarily converted to svn_string_t, i.e. don't modify them.
> This is fine since svn_string_ts are considered immutable.
>
> * subversion/libsvn_subr/string.c
> (svn_stringbuf__morph_into_string): remove paranoia debug code
>
> Modified: subversion/branches/fsfs-format7/subversion/libsvn_subr/string.c
> ==============================================================================
> svn_string_t *
> svn_stringbuf__morph_into_string(svn_stringbuf_t *strbuf)
> {
> - /* In debug mode, detect attempts to modify the original STRBUF object.
> - */
> -#ifdef SVN_DEBUG
> - strbuf->pool = NULL;
> - strbuf->blocksize = strbuf->len + 1;
> -#endif
> -
> /* Both, svn_string_t and svn_stringbuf_t are public API structures
> * since the svn epoch. Thus, we can rely on their precise layout not
> * to change.
Received on 2013-03-27 21:16:38 CET