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/01/13 01:25:20 UTC
svn commit: r1651244 - in /subversion/trunk/subversion/libsvn_fs_x:
noderevs.c noderevs.h reps.c reps.h string_table.c string_table.h
Author: stefan2
Date: Tue Jan 13 00:25:20 2015
New Revision: 1651244
URL: http://svn.apache.org/r1651244
Log:
In FSX, the container object constructors don't create temporary data,
so their pool parameter shall be named result_pool.
* subversion/libsvn_fs_x/noderevs.h
(svn_fs_x__noderevs_create): The POOL is a pure RESULT_POOL.
* subversion/libsvn_fs_x/noderevs.c
(svn_fs_x__noderevs_create): Same.
* subversion/libsvn_fs_x/reps.h
(svn_fs_x__reps_builder_create): Same.
* subversion/libsvn_fs_x/reps.c
(allocate_hash_members,
init_hash,
svn_fs_x__reps_builder_create): Same.
* subversion/libsvn_fs_x/string_table.h
(svn_fs_x__string_table_builder_create): Same.
* subversion/libsvn_fs_x/string_table.c
(svn_fs_x__string_table_builder_create): Same.
Modified:
subversion/trunk/subversion/libsvn_fs_x/noderevs.c
subversion/trunk/subversion/libsvn_fs_x/noderevs.h
subversion/trunk/subversion/libsvn_fs_x/reps.c
subversion/trunk/subversion/libsvn_fs_x/reps.h
subversion/trunk/subversion/libsvn_fs_x/string_table.c
subversion/trunk/subversion/libsvn_fs_x/string_table.h
Modified: subversion/trunk/subversion/libsvn_fs_x/noderevs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/noderevs.c?rev=1651244&r1=1651243&r2=1651244&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/noderevs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/noderevs.c Tue Jan 13 00:25:20 2015
@@ -167,21 +167,23 @@ struct svn_fs_x__noderevs_t
svn_fs_x__noderevs_t *
svn_fs_x__noderevs_create(int initial_count,
- apr_pool_t* pool)
+ apr_pool_t* result_pool)
{
- svn_fs_x__noderevs_t *noderevs = apr_palloc(pool, sizeof(*noderevs));
+ svn_fs_x__noderevs_t *noderevs
+ = apr_palloc(result_pool, sizeof(*noderevs));
- noderevs->builder = svn_fs_x__string_table_builder_create(pool);
- noderevs->ids_dict = svn_hash__make(pool);
- noderevs->reps_dict = svn_hash__make(pool);
+ noderevs->builder = svn_fs_x__string_table_builder_create(result_pool);
+ noderevs->ids_dict = svn_hash__make(result_pool);
+ noderevs->reps_dict = svn_hash__make(result_pool);
noderevs->paths = NULL;
noderevs->ids
- = apr_array_make(pool, 2 * initial_count, sizeof(svn_fs_x__id_t));
+ = apr_array_make(result_pool, 2 * initial_count, sizeof(svn_fs_x__id_t));
noderevs->reps
- = apr_array_make(pool, 2 * initial_count, sizeof(binary_representation_t));
+ = apr_array_make(result_pool, 2 * initial_count,
+ sizeof(binary_representation_t));
noderevs->noderevs
- = apr_array_make(pool, initial_count, sizeof(binary_noderev_t));
+ = apr_array_make(result_pool, initial_count, sizeof(binary_noderev_t));
return noderevs;
}
Modified: subversion/trunk/subversion/libsvn_fs_x/noderevs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/noderevs.h?rev=1651244&r1=1651243&r2=1651244&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/noderevs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/noderevs.h Tue Jan 13 00:25:20 2015
@@ -47,11 +47,12 @@ typedef struct svn_fs_x__noderevs_t svn_
/* Create and populate noderev containers. */
/* Create and return a new noderevs container with an initial capacity of
- * INITIAL_COUNT svn_fs_x__noderev_t objects. Allocate the result in POOL.
+ * INITIAL_COUNT svn_fs_x__noderev_t objects.
+ * Allocate the result in RESULT_POOL.
*/
svn_fs_x__noderevs_t *
svn_fs_x__noderevs_create(int initial_count,
- apr_pool_t *pool);
+ apr_pool_t *result_pool);
/* Add NODEREV to the CONTAINER. Return the index that identifies the new
* item in this container.
Modified: subversion/trunk/subversion/libsvn_fs_x/reps.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/reps.c?rev=1651244&r1=1651243&r2=1651244&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/reps.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/reps.c Tue Jan 13 00:25:20 2015
@@ -302,38 +302,40 @@ hash_to_index(hash_t *hash, hash_key_t a
return (adler32 * 0xd1f3da69) >> hash->shift;
}
-/* Allocate and initialized SIZE buckets in POOL. Assign them to HASH.
+/* Allocate and initialized SIZE buckets in RESULT_POOL.
+ * Assign them to HASH.
*/
static void
allocate_hash_members(hash_t *hash,
apr_size_t size,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
apr_size_t i;
- hash->pool = pool;
+ hash->pool = result_pool;
hash->size = size;
- hash->prefixes = apr_pcalloc(pool, size);
- hash->last_matches = apr_pcalloc(pool, sizeof(*hash->last_matches) * size);
- hash->offsets = apr_palloc(pool, sizeof(*hash->offsets) * size);
+ hash->prefixes = apr_pcalloc(result_pool, size);
+ hash->last_matches = apr_pcalloc(result_pool,
+ sizeof(*hash->last_matches) * size);
+ hash->offsets = apr_palloc(result_pool, sizeof(*hash->offsets) * size);
for (i = 0; i < size; ++i)
hash->offsets[i] = NO_OFFSET;
}
/* Initialize the HASH data structure with 2**TWOPOWER buckets allocated
- * in POOL.
+ * in RESULT_POOL.
*/
static void
init_hash(hash_t *hash,
apr_size_t twoPower,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
hash->used = 0;
hash->shift = sizeof(hash_key_t) * 8 - twoPower;
- allocate_hash_members(hash, 1 << twoPower, pool);
+ allocate_hash_members(hash, 1 << twoPower, result_pool);
}
/* Make HASH have at least MIN_SIZE buckets but at least double the number
@@ -384,17 +386,19 @@ grow_hash(hash_t *hash,
svn_fs_x__reps_builder_t *
svn_fs_x__reps_builder_create(svn_fs_t *fs,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
- svn_fs_x__reps_builder_t *result = apr_pcalloc(pool, sizeof(*result));
+ svn_fs_x__reps_builder_t *result = apr_pcalloc(result_pool,
+ sizeof(*result));
result->fs = fs;
- result->text = svn_stringbuf_create_empty(pool);
- init_hash(&result->hash, 4, pool);
+ result->text = svn_stringbuf_create_empty(result_pool);
+ init_hash(&result->hash, 4, result_pool);
- result->bases = apr_array_make(pool, 0, sizeof(base_t));
- result->reps = apr_array_make(pool, 0, sizeof(rep_t));
- result->instructions = apr_array_make(pool, 0, sizeof(instruction_t));
+ result->bases = apr_array_make(result_pool, 0, sizeof(base_t));
+ result->reps = apr_array_make(result_pool, 0, sizeof(rep_t));
+ result->instructions = apr_array_make(result_pool, 0,
+ sizeof(instruction_t));
return result;
}
Modified: subversion/trunk/subversion/libsvn_fs_x/reps.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/reps.h?rev=1651244&r1=1651243&r2=1651244&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/reps.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/reps.h Tue Jan 13 00:25:20 2015
@@ -71,11 +71,11 @@ typedef struct svn_fs_x__reps_baton_t
/* Create and populate noderev containers. */
-/* Create and return a new builder object, allocated in POOL.
+/* Create and return a new builder object, allocated in RESULT_POOL.
*/
svn_fs_x__reps_builder_t *
svn_fs_x__reps_builder_create(svn_fs_t *fs,
- apr_pool_t *pool);
+ apr_pool_t *result_pool);
/* To BUILDER, add reference to the fulltext currently stored in
* representation REP. Substrings matching with any of the base reps
Modified: subversion/trunk/subversion/libsvn_fs_x/string_table.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/string_table.c?rev=1651244&r1=1651243&r2=1651244&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/string_table.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/string_table.c Tue Jan 13 00:25:20 2015
@@ -121,11 +121,11 @@ add_table(string_table_builder_t *builde
}
string_table_builder_t *
-svn_fs_x__string_table_builder_create(apr_pool_t *pool)
+svn_fs_x__string_table_builder_create(apr_pool_t *result_pool)
{
- string_table_builder_t *result = apr_palloc(pool, sizeof(*result));
- result->pool = pool;
- result->tables = apr_array_make(pool, 1, sizeof(builder_table_t *));
+ string_table_builder_t *result = apr_palloc(result_pool, sizeof(*result));
+ result->pool = result_pool;
+ result->tables = apr_array_make(result_pool, 1, sizeof(builder_table_t *));
add_table(result);
Modified: subversion/trunk/subversion/libsvn_fs_x/string_table.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/string_table.h?rev=1651244&r1=1651243&r2=1651244&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/string_table.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/string_table.h Tue Jan 13 00:25:20 2015
@@ -47,10 +47,10 @@ typedef struct string_table_builder_t st
/* the string table */
typedef struct string_table_t string_table_t;
-/* Returns a new string table builder object, allocated in POOL.
+/* Returns a new string table builder object, allocated in RESULT_POOL.
*/
string_table_builder_t *
-svn_fs_x__string_table_builder_create(apr_pool_t *pool);
+svn_fs_x__string_table_builder_create(apr_pool_t *result_pool);
/* Add an arbitrary NUL-terminated C-string STRING of the given length LEN
* to BUILDER. Return the index of that string in the future string table.