subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <philip.mar...@wandisco.com>
Subject Re: svn commit: r1327979 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_fs/fs-loader.c libsvn_repos/fs-wrap.c mod_dav_svn/repos.c
Date Thu, 19 Apr 2012 16:18:25 GMT
Greg Stein <gstein@gmail.com> writes:

> On Apr 19, 2012 11:02 AM, <philip@apache.org> wrote:
>>...
>> +++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Thu Apr 19 15:02:17
> 2012
>>...
>> +      if (kind == svn_node_dir)
>> +        {
>> +          svn_error_clear(err);
>> +          *fs_type = apr_pstrdup(pool, SVN_FS_TYPE_BDB);
>> +          return SVN_NO_ERROR;
>
> There's no need to dup a constant string.

I moved that code without considering that.  The documentation
explicitly states that the result is allocated in pool but I think we
can change that.  It also allows me to rename pool to scratch_pool.  I
suppose there is a theoretical problem if libsvn_fs is dynamically
loaded and the caller is passing a pool with a longer lifetime than the
library.  The constant string in the dynamic library would then have a
shorter lifetime than it does now.  Unlikely in practice I think.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com

Mime
View raw message