subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1651253 - in /subversion/trunk/subversion/libsvn_fs_x: fs_x.c fs_x.h
Date Tue, 13 Jan 2015 01:07:40 GMT
Author: stefan2
Date: Tue Jan 13 01:07:39 2015
New Revision: 1651253

URL: http://svn.apache.org/r1651253
Log:
Continue migrating FSX to the two-pool paradigm.  Some single-pool functions
don't allocate temporary data, i.e. their pools can immediately be renamed
to RESULT_POOL.  Do this for fs_x.* .

* subversion/libsvn_fs_x/fs_x.c
  (svn_fs_x__file_checksum): POOL is actually a RESULT_POOL.
  (svn_fs_x__rep_copy): Same.  Simplify the copy code.

* subversion/libsvn_fs_x/fs_x.h
  (svn_fs_x__rep_copy,
   svn_fs_x__file_checksum): Make the header reflect the source file changes.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/fs_x.c
    subversion/trunk/subversion/libsvn_fs_x/fs_x.h

Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.c?rev=1651253&r1=1651252&r2=1651253&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_x.c Tue Jan 13 01:07:39 2015
@@ -801,7 +801,7 @@ svn_error_t *
 svn_fs_x__file_checksum(svn_checksum_t **checksum,
                         svn_fs_x__noderev_t *noderev,
                         svn_checksum_kind_t kind,
-                        apr_pool_t *pool)
+                        apr_pool_t *result_pool)
 {
   *checksum = NULL;
 
@@ -827,7 +827,7 @@ svn_fs_x__file_checksum(svn_checksum_t *
             return SVN_NO_ERROR;
         }
 
-      *checksum = svn_checksum_dup(&temp, pool);
+      *checksum = svn_checksum_dup(&temp, result_pool);
     }
 
   return SVN_NO_ERROR;
@@ -835,18 +835,12 @@ svn_fs_x__file_checksum(svn_checksum_t *
 
 svn_fs_x__representation_t *
 svn_fs_x__rep_copy(svn_fs_x__representation_t *rep,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool)
 {
-  svn_fs_x__representation_t *rep_new;
-
   if (rep == NULL)
     return NULL;
 
-  rep_new = apr_palloc(pool, sizeof(*rep_new));
-
-  memcpy(rep_new, rep, sizeof(*rep_new));
-
-  return rep_new;
+  return apr_pmemdup(result_pool, rep, sizeof(*rep));
 }
 
 

Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.h?rev=1651253&r1=1651252&r2=1651253&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_x.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_x.h Tue Jan 13 01:07:39 2015
@@ -109,20 +109,20 @@ svn_fs_x__prop_rep_equal(svn_boolean_t *
                          apr_pool_t *scratch_pool);
 
 
-/* Return a copy of the representation REP allocated from POOL. */
+/* Return a copy of the representation REP allocated from RESULT_POOL. */
 svn_fs_x__representation_t *
 svn_fs_x__rep_copy(svn_fs_x__representation_t *rep,
-                   apr_pool_t *pool);
+                   apr_pool_t *result_pool);
 
 
 /* Return the recorded checksum of type KIND for the text representation
-   of NODREV into CHECKSUM, allocating from POOL.  If no stored checksum is
-   available, put all NULL into CHECKSUM. */
+   of NODREV into CHECKSUM, allocating from RESULT_POOL.  If no stored
+   checksum is available, put all NULL into CHECKSUM. */
 svn_error_t *
 svn_fs_x__file_checksum(svn_checksum_t **checksum,
                         svn_fs_x__noderev_t *noderev,
                         svn_checksum_kind_t kind,
-                        apr_pool_t *pool);
+                        apr_pool_t *result_pool);
 
 /* Under the repository db PATH, create a FSFS repository with FORMAT,
  * the given SHARD_SIZE.  If not supported by the respective format,



Mime
View raw message