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/14 02:32:05 UTC
svn commit: r1651550 - in /subversion/trunk/subversion/libsvn_fs_x: util.c
util.h
Author: stefan2
Date: Wed Jan 14 01:32:05 2015
New Revision: 1651550
URL: http://svn.apache.org/r1651550
Log:
* subversion/libsvn_fs_x/util.c
(svn_fs_x__path_rev_shard,
svn_fs_x__path_revprops_shard): Use an itoa function that does not
allocate a temporary buffer. Then
the POOL becomes a pure RESULT_POOL.
* subversion/libsvn_fs_x/util.h
(svn_fs_x__path_rev_shard,
svn_fs_x__path_revprops_shard): Make header match the implementation.
Modified:
subversion/trunk/subversion/libsvn_fs_x/util.c
subversion/trunk/subversion/libsvn_fs_x/util.h
Modified: subversion/trunk/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/util.c?rev=1651550&r1=1651549&r2=1651550&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/util.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/util.c Wed Jan 14 01:32:05 2015
@@ -160,12 +160,16 @@ svn_fs_x__path_rev_packed(svn_fs_t *fs,
}
const char *
-svn_fs_x__path_rev_shard(svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool)
+svn_fs_x__path_rev_shard(svn_fs_t *fs,
+ svn_revnum_t rev,
+ apr_pool_t *result_pool)
{
svn_fs_x__data_t *ffd = fs->fsap_data;
- return svn_dirent_join_many(pool, fs->path, PATH_REVS_DIR,
- apr_psprintf(pool, "%ld",
- rev / ffd->max_files_per_dir),
+
+ char buffer[SVN_INT64_BUFFER_SIZE];
+ svn__i64toa(buffer, rev / ffd->max_files_per_dir);
+
+ return svn_dirent_join_many(result_pool, fs->path, PATH_REVS_DIR, buffer,
SVN_VA_NULL);
}
@@ -192,14 +196,15 @@ svn_fs_x__path_rev_absolute(svn_fs_t *fs
const char *
svn_fs_x__path_revprops_shard(svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
svn_fs_x__data_t *ffd = fs->fsap_data;
- return svn_dirent_join_many(pool, fs->path, PATH_REVPROPS_DIR,
- apr_psprintf(pool, "%ld",
- rev / ffd->max_files_per_dir),
- SVN_VA_NULL);
+ char buffer[SVN_INT64_BUFFER_SIZE];
+ svn__i64toa(buffer, rev / ffd->max_files_per_dir);
+
+ return svn_dirent_join_many(result_pool, fs->path, PATH_REVPROPS_DIR,
+ buffer, SVN_VA_NULL);
}
const char *
Modified: subversion/trunk/subversion/libsvn_fs_x/util.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/util.h?rev=1651550&r1=1651549&r2=1651550&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/util.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/util.h Wed Jan 14 01:32:05 2015
@@ -155,12 +155,12 @@ svn_fs_x__path_rev_packed(svn_fs_t *fs,
apr_pool_t *pool);
/* Return the full path of the rev shard directory that will contain
- * revision REV in FS. Allocate the result in POOL.
+ * revision REV in FS. Allocate the result in RESULT_POOL.
*/
const char *
svn_fs_x__path_rev_shard(svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool);
+ apr_pool_t *result_pool);
/* Return the full path of the non-packed rev file containing revision REV
* in FS. Allocate the result in POOL.
@@ -185,12 +185,12 @@ svn_fs_x__path_rev_absolute(svn_fs_t *fs
/* Return the full path of the revision properties shard directory that
* will contain the properties of revision REV in FS.
- * Allocate the result in POOL.
+ * Allocate the result in RESULT_POOL.
*/
const char *
svn_fs_x__path_revprops_shard(svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool);
+ apr_pool_t *result_pool);
/* Return the full path of the revision properties pack shard directory
* that will contain the packed properties of revision REV in FS.