[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Moves in FSFS

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Sun, 29 Sep 2013 18:38:32 +0200

On Sun, Sep 29, 2013 at 2:08 AM, Bill Tutt <bill_at_tutts.org> wrote:

> On a slightly different note I noticed this oddity in lib_fs_fs/dag.c from
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?annotate=1517479
>
> 703 jpieper849539<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=849538&r2=849539&> if
> (is_parent_copyroot) 704jpieper 849532<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=849531&r2=849532&>{705
> danielsh 1305396<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=1305395&r2=1305396&>SVN_ERR(get_node_revision(&parent_noderev, parent));706
> jpieper 849539<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=849538&r2=849539&>noderev->copyroot_rev = parent_noderev->copyroot_rev;707
> kfogel 858545<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=858544&r2=858545&>noderev->copyroot_path = apr_pstrdup(pool,708
> parent_noderev->copyroot_path); 709jpieper 849532<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=849531&r2=849532&>}710
> hwright 866391<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=866390&r2=866391&>
> 711jpieper 849539<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=849538&r2=849539&>noderev->copyfrom_path = NULL;712
> noderev->copyfrom_rev = SVN_INVALID_REVNUM; 713hwright
>
> 866391<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=866390&r2=866391&>
>
>
> Sure looks like a useless memory allocation from the APR pool for
> copyroot_path as well as dead code rotting away quietly.
>
> As well as this earlier in the same file:
> 394 kfogel858545<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=858544&r2=858545&> new_noderev.copyroot_path
> = apr_pstrdup(pool, 395 parent_noderev->copyroot_path); 396jpieper
> 849539<http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?r1=849538&r2=849539&>new_noderev.copyroot_rev = parent_noderev->copyroot_rev;397
> new_noderev.copyfrom_rev = SVN_INVALID_REVNUM; 398 new_noderev.copyfrom_path = NULL;
>
> Wow, this has been here for ages... :)
>

Thanks Bill for spotting this. Fixed in r1527344.

-- Stefan^2.
Received on 2013-09-29 18:39:30 CEST

This is an archived mail posted to the Subversion Dev mailing list.