On Wed, Aug 18, 2010 at 1:11 AM, <stefan2_at_apache.org> wrote:
> Author: stefan2
> Date: Tue Aug 17 23:11:13 2010
> New Revision: 986521
>
> URL: http://svn.apache.org/viewvc?rev=986521&view=rev
> Log:
> Change serialized representation of pointers: instead of storing offsets
> relative to the whole buffer, store the offset relative to the (local) structure
> that immediately contains that pointer as an element.
>
> Also, store directory content hashes in lexicographical order of their names.
> This will soon be used to implement sub-entry cache access.
>
> * subversion/libsvn_subr/svn_temp_serializer.c
> (store_current_end_pointer): store the pointer target as offset relative to the
> current struct's start offset (instead of the global position in the buffer)
> * subversion/libsvn_fs_fs/id.c
> (deserialize_id_private, svn_fs_fs__id_deserialize):
> resolve ptrs local to their containing struct
> * subversion/libsvn_fs_fs/temp_serializer.c
> (deserialize_svn_string, deserialize_checksum, deserialize_representation,
> deserialize_dir, svn_fs_fs__noderev_deserialize,
> svn_fs_fs__deserialize_txdelta_window): dito
> (hash_data_t, compare_dirent_id_names, serialize_dir):
> serialize hash entries sorted by the hash key, i.e. the name
>
> Modified:
> subversion/branches/performance/subversion/libsvn_fs_fs/id.c
> subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c
> subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c
<snip>
> Modified: subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c
> URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c?rev=986521&r1=986520&r2=986521&view=diff
> ==============================================================================
> --- subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c (original)
> +++ subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c Tue Aug 17 23:11:13 2010
<snip>
> @@ -265,14 +271,20 @@ serialize_dir(apr_hash_t *entries, apr_p
>
> /* calculate sizes */
> apr_size_t count = apr_hash_count(entries);
> - apr_size_t entries_len = sizeof(svn_fs_dirent_t[count]);
> + apr_size_t entries_len = sizeof(svn_fs_dirent_t*[count]);
>
> /* copy the hash entries to an auxilliary struct of known layout */
> hash_data.count = count;
> hash_data.entries = apr_palloc(pool, entries_len);
>
> for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi), ++i)
> - hash_data.entries[i] = *(svn_fs_dirent_t *)svn__apr_hash_index_val(hi);
> + hash_data.entries[i] = svn__apr_hash_index_val(hi);
> +
> + /* sort entry index by ID name */
> + qsort(hash_data.entries,
> + count,
> + sizeof(*hash_data.entries),
> + (comparison_fn_t)compare_dirent_id_names);
This change caused this compilation error for me (on Windows, with
Visual C Express 2008):
..\..\..\subversion\libsvn_fs_fs\temp_serializer.c(287): error C2065:
'comparison_fn_t' : undeclared identifier
..\..\..\subversion\libsvn_fs_fs\temp_serializer.c(287): error C4047:
'function' : 'int (__cdecl *)(const void *,const void *)' differs in
levels of indirection from 'int'
..\..\..\subversion\libsvn_fs_fs\temp_serializer.c(287): error C4024:
'qsort' : different types for formal and actual parameter 4
..\..\..\subversion\libsvn_fs_fs\temp_serializer.c(287): error C2146:
syntax error : missing ')' before identifier 'compare_dirent_id_names'
..\..\..\subversion\libsvn_fs_fs\temp_serializer.c(287): error C2059:
syntax error : ')'
Unless I missed something or did something wrong (had to resolve some
merge conflicts, because I had made some changes to get it to compile
-> see other thread).
Cheers,
--
Johan
Received on 2010-08-18 23:51:28 CEST