subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1671337 - in /subversion/branches/fsx-1.10/subversion/libsvn_fs_x: string_table.c string_table.h
Date Sat, 04 Apr 2015 21:16:23 GMT
Author: stefan2
Date: Sat Apr  4 21:16:22 2015
New Revision: 1671337

URL: http://svn.apache.org/r1671337
Log:
On the fsx-1.10 branch:
In FSX strings container code, name result pools properly.

* subversion/libsvn_fs_x/string_table.c
  (create_table,
   svn_fs_x__string_table_create,
   svn_fs_x__string_table_get,
   svn_fs_x__string_table_get_func): POOL is a pure RESULT_POOL.

* subversion/libsvn_fs_x/string_table.h
  (svn_fs_x__string_table_create): 
  (svn_fs_x__string_table_get): 
  (svn_fs_x__string_table_get_func): Sync. declaration with implementation.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.h

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.c?rev=1671337&r1=1671336&r2=1671337&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.c Sat Apr  4 21:16:22
2015
@@ -376,7 +376,7 @@ svn_fs_x__string_table_builder_estimate_
 static void
 create_table(string_sub_table_t *target,
              builder_table_t *source,
-             apr_pool_t *pool,
+             apr_pool_t *result_pool,
              apr_pool_t *scratch_pool)
 {
   int i = 0;
@@ -387,7 +387,8 @@ create_table(string_sub_table_t *target,
 
   /* pack sub-strings */
   target->short_string_count = (apr_size_t)source->short_strings->nelts;
-  target->short_strings = apr_palloc(pool, sizeof(*target->short_strings) *
+  target->short_strings = apr_palloc(result_pool,
+                                     sizeof(*target->short_strings) *
                                            target->short_string_count);
   for (i = 0; i < source->short_strings->nelts; ++i)
     {
@@ -433,13 +434,14 @@ create_table(string_sub_table_t *target,
 
   /* pack long strings */
   target->long_string_count = (apr_size_t)source->long_strings->nelts;
-  target->long_strings = apr_palloc(pool, sizeof(*target->long_strings) *
+  target->long_strings = apr_palloc(result_pool,
+                                    sizeof(*target->long_strings) *
                                           target->long_string_count);
   for (i = 0; i < source->long_strings->nelts; ++i)
     {
       svn_string_t *string = &target->long_strings[i];
       *string = APR_ARRAY_IDX(source->long_strings, i, svn_string_t);
-      string->data = apr_pstrmemdup(pool, string->data, string->len);
+      string->data = apr_pstrmemdup(result_pool, string->data, string->len);
     }
 
   data->len += PADDING; /* add a few extra bytes at the end of the buffer
@@ -447,25 +449,25 @@ create_table(string_sub_table_t *target,
   assert(data->len < data->blocksize);
   memset(data->data + data->len - PADDING, 0, PADDING);
 
-  target->data = apr_pmemdup(pool, data->data, data->len);
+  target->data = apr_pmemdup(result_pool, data->data, data->len);
   target->data_size = data->len;
 }
 
 string_table_t *
 svn_fs_x__string_table_create(const string_table_builder_t *builder,
-                              apr_pool_t *pool)
+                              apr_pool_t *result_pool)
 {
   apr_size_t i;
   
-  string_table_t *result = apr_pcalloc(pool, sizeof(*result));
+  string_table_t *result = apr_pcalloc(result_pool, sizeof(*result));
   result->size = (apr_size_t)builder->tables->nelts;
   result->sub_tables
-    = apr_pcalloc(pool, result->size * sizeof(*result->sub_tables));
+    = apr_pcalloc(result_pool, result->size * sizeof(*result->sub_tables));
 
   for (i = 0; i < result->size; ++i)
     create_table(&result->sub_tables[i],
                  APR_ARRAY_IDX(builder->tables, i, builder_table_t*),
-                 pool,
+                 result_pool,
                  builder->pool);
 
   return result;
@@ -542,7 +544,7 @@ const char*
 svn_fs_x__string_table_get(const string_table_t *table,
                            apr_size_t idx,
                            apr_size_t *length,
-                           apr_pool_t *pool)
+                           apr_pool_t *result_pool)
 {
   apr_size_t table_number = idx >> TABLE_SHIFT;
   apr_size_t sub_index = idx & STRING_INDEX_MASK;
@@ -557,7 +559,7 @@ svn_fs_x__string_table_get(const string_
               if (length)
                 *length = sub_table->long_strings[sub_index].len;
 
-              return apr_pstrmemdup(pool,
+              return apr_pstrmemdup(result_pool,
                                     sub_table->long_strings[sub_index].data,
                                     sub_table->long_strings[sub_index].len);
             }
@@ -568,7 +570,7 @@ svn_fs_x__string_table_get(const string_
             {
               string_header_t *header = sub_table->short_strings + sub_index;
               apr_size_t len = header->head_length + header->tail_length;
-              char *result = apr_palloc(pool, len + PADDING);
+              char *result = apr_palloc(result_pool, len + PADDING);
 
               if (length)
                 *length = len;
@@ -579,7 +581,7 @@ svn_fs_x__string_table_get(const string_
         }
     }
 
-  return apr_pstrmemdup(pool, "", 0);
+  return apr_pstrmemdup(result_pool, "", 0);
 }
 
 svn_error_t *
@@ -830,7 +832,7 @@ const char*
 svn_fs_x__string_table_get_func(const string_table_t *table,
                                 apr_size_t idx,
                                 apr_size_t *length,
-                                apr_pool_t *pool)
+                                apr_pool_t *result_pool)
 {
   apr_size_t table_number = idx >> TABLE_SHIFT;
   apr_size_t sub_index = idx & STRING_INDEX_MASK;
@@ -861,7 +863,7 @@ svn_fs_x__string_table_get_func(const st
               if (length)
                 *length = long_strings[sub_index].len;
 
-              return apr_pstrmemdup(pool,
+              return apr_pstrmemdup(result_pool,
                                     str_data,
                                     long_strings[sub_index].len);
             }
@@ -889,7 +891,7 @@ svn_fs_x__string_table_get_func(const st
               /* reconstruct the char data and return it */
               header = table_copy.short_strings + sub_index;
               len = header->head_length + header->tail_length;
-              result = apr_palloc(pool, len + PADDING);
+              result = apr_palloc(result_pool, len + PADDING);
               if (length)
                 *length = len;
 

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.h?rev=1671337&r1=1671336&r2=1671337&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/string_table.h Sat Apr  4 21:16:22
2015
@@ -69,21 +69,21 @@ apr_size_t
 svn_fs_x__string_table_builder_estimate_size(string_table_builder_t *builder);
 
 /* From the given BUILDER object, create a string table object allocated
- * in POOL that contains all strings previously added to BUILDER.
+ * in RESULT_POOL that contains all strings previously added to BUILDER.
  */
 string_table_t *
 svn_fs_x__string_table_create(const string_table_builder_t *builder,
-                              apr_pool_t *pool);
+                              apr_pool_t *result_pool);
 
 /* Extract string number INDEX from TABLE and return a copy of it allocated
- * in POOL.  If LENGTH is not NULL, set *LENGTH to strlen() of the result
- * string.  Returns an empty string for invalid indexes.
+ * in RESULT_POOL.  If LENGTH is not NULL, set *LENGTH to strlen() of the
+ * result string.  Returns an empty string for invalid indexes.
  */
 const char*
 svn_fs_x__string_table_get(const string_table_t *table,
                            apr_size_t index,
                            apr_size_t *length,
-                           apr_pool_t *pool);
+                           apr_pool_t *result_pool);
 
 /* Write a serialized representation of the string table TABLE to STREAM.
  * Use SCRATCH_POOL for temporary allocations.
@@ -116,15 +116,15 @@ svn_fs_x__deserialize_string_table(void
                                    string_table_t **table);
 
 /* Extract string number INDEX from the cache serialized representation at
- * TABLE and return a copy of it allocated in POOL.  If LENGTH is not NULL,
- * set *LENGTH to strlen() of the result string.  Returns an empty string
- * for invalid indexes.
+ * TABLE and return a copy of it allocated in RESULT_POOL.  If LENGTH is not
+ * NULL, set *LENGTH to strlen() of the result string.  Returns an empty
+ * string for invalid indexes.
  */
 const char*
 svn_fs_x__string_table_get_func(const string_table_t *table,
                                 apr_size_t idx,
                                 apr_size_t *length,
-                                apr_pool_t *pool);
+                                apr_pool_t *result_pool);
 
 #ifdef __cplusplus
 }



Mime
View raw message