You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/10/24 18:06:09 UTC

svn commit: r1710360 - /subversion/trunk/subversion/libsvn_fs/fs-loader.c

Author: stefan2
Date: Sat Oct 24 16:06:08 2015
New Revision: 1710360

URL: http://svn.apache.org/viewvc?rev=1710360&view=rev
Log:
Reduce the permanent memory footprint of svn_fs_create.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_create): FS creation is a quite memory intensive operation,
                   so use a scratch pool for anything temporary.

Modified:
    subversion/trunk/subversion/libsvn_fs/fs-loader.c

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1710360&r1=1710359&r2=1710360&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Sat Oct 24 16:06:08 2015
@@ -510,22 +510,25 @@ svn_fs_create(svn_fs_t **fs_p, const cha
               apr_pool_t *pool)
 {
   fs_library_vtable_t *vtable;
+  apr_pool_t *scratch_pool = svn_pool_create(pool);
 
   const char *fs_type = svn_hash__get_cstring(fs_config,
                                               SVN_FS_CONFIG_FS_TYPE,
                                               DEFAULT_FS_TYPE);
-  SVN_ERR(get_library_vtable(&vtable, fs_type, pool));
+  SVN_ERR(get_library_vtable(&vtable, fs_type, scratch_pool));
 
   /* Create the FS directory and write out the fsap-name file. */
-  SVN_ERR(svn_io_dir_make_sgid(path, APR_OS_DEFAULT, pool));
-  SVN_ERR(write_fs_type(path, fs_type, pool));
+  SVN_ERR(svn_io_dir_make_sgid(path, APR_OS_DEFAULT, scratch_pool));
+  SVN_ERR(write_fs_type(path, fs_type, scratch_pool));
 
   /* Perform the actual creation. */
   *fs_p = fs_new(fs_config, pool);
 
-  SVN_ERR(vtable->create(*fs_p, path, common_pool_lock, pool, common_pool));
+  SVN_ERR(vtable->create(*fs_p, path, common_pool_lock, scratch_pool,
+                         common_pool));
   SVN_ERR(vtable->set_svn_fs_open(*fs_p, svn_fs_open2));
 
+  svn_pool_destroy(scratch_pool);
   return SVN_NO_ERROR;
 }