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 2013/02/04 10:43:31 UTC
svn commit: r1442058 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Author: stefan2
Date: Mon Feb 4 09:43:30 2013
New Revision: 1442058
URL: http://svn.apache.org/viewvc?rev=1442058&view=rev
Log:
Fix a subtle cache inefficiency in 1.8 (does not exist in 1.7):
When using a struct as cache key, its content cannot always be
initialized by assigning all members. Due to data alignment,
4 of the 16 bytes in pair_cache_key_t will have random content
if its first member (a long) is 4 instead 8 bytes long.
* subversion/libsvn_fs_fs/fs_fs.c
(get_cached_node_revision_body,
set_cached_node_revision_body,
parse_revprop,
get_revision_proplist,
read_representation,
svn_fs_fs__try_process_file_contents,
svn_fs_fs__get_proplist): explicitly initialize the *whole* key
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1442058&r1=1442057&r2=1442058&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Mon Feb 4 09:43:30 2013
@@ -2244,7 +2244,7 @@ get_cached_node_revision_body(node_revis
}
else
{
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
key.revision = svn_fs_fs__id_rev(id);
key.second = svn_fs_fs__id_offset(id);
@@ -2273,7 +2273,7 @@ set_cached_node_revision_body(node_revis
if (ffd->node_revision_cache && !svn_fs_fs__id_txn_id(id))
{
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
key.revision = svn_fs_fs__id_rev(id);
key.second = svn_fs_fs__id_offset(id);
@@ -3536,7 +3536,7 @@ parse_revprop(apr_hash_t **properties,
if (has_revprop_cache(fs, pool))
{
fs_fs_data_t *ffd = fs->fsap_data;
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
key.revision = revision;
key.second = generation;
@@ -3839,7 +3839,7 @@ get_revision_proplist(apr_hash_t **propl
if (has_revprop_cache(fs, pool))
{
svn_boolean_t is_cached;
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
SVN_ERR(read_revprop_generation(&generation, fs, pool));
@@ -5192,7 +5192,7 @@ read_representation(svn_stream_t **conte
else
{
fs_fs_data_t *ffd = fs->fsap_data;
- pair_cache_key_t fulltext_cache_key;
+ pair_cache_key_t fulltext_cache_key = { 0 };
svn_filesize_t len = rep->expanded_size ? rep->expanded_size : rep->size;
struct rep_read_baton *rb;
@@ -5366,7 +5366,7 @@ svn_fs_fs__try_process_file_contents(svn
if (rep)
{
fs_fs_data_t *ffd = fs->fsap_data;
- pair_cache_key_t fulltext_cache_key;
+ pair_cache_key_t fulltext_cache_key = { 0 };
fulltext_cache_key.revision = rep->revision;
fulltext_cache_key.second = rep->offset;
@@ -5673,7 +5673,7 @@ svn_fs_fs__get_proplist(apr_hash_t **pro
{
fs_fs_data_t *ffd = fs->fsap_data;
representation_t *rep = noderev->prop_rep;
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
key.revision = rep->revision;
key.second = rep->offset;