Author: stefan2
Date: Fri Oct 28 23:12:03 2011
New Revision: 1190664

URL: http://svn.apache.org/viewvc?rev=1190664&view=rev
Log:
Merging relevant changes from the performance branch, part 2:
r981665. Resolved conflicts in svn_temp_serializer.*

Modified:
    subversion/branches/file-handle-cache/   (props changed)
    
subversion/branches/file-handle-cache/subversion/include/private/svn_file_handle_cache.h
   (contents, props changed)
    
subversion/branches/file-handle-cache/subversion/include/private/svn_temp_serializer.h
    
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_file_handle_cache.c
   (contents, props changed)
    
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_temp_serializer.c

Propchange: subversion/branches/file-handle-cache/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 28 23:12:03 2011
@@ -38,7 +38,7 @@
 /subversion/branches/log-g-performance:870941-871032
 /subversion/branches/merge-skips-obstructions:874525-874615
 /subversion/branches/nfc-nfd-aware-client:870276,870376
-/subversion/branches/performance:979193,980118,981087,981090-981091,981189,981194,981204,981287,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985673,985695,985697,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-1029336,1029
 
339-1029340,1029342,1029344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
+/subversion/branches/performance:979193,980118,981087,981090-981091,981189,981194,981204,981287,981665,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985673,985695,985697,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-10293
 
36,1029339-1029340,1029342,1029344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
 /subversion/branches/py-tests-as-modules:956579-1033052
 /subversion/branches/ra_serf-digest-authn:875693-876404
 /subversion/branches/reintegrate-improvements:873853-874164

Modified: 
subversion/branches/file-handle-cache/subversion/include/private/svn_file_handle_cache.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/file-handle-cache/subversion/include/private/svn_file_handle_cache.h?rev=1190664&r1=1190663&r2=1190664&view=diff
==============================================================================
--- 
subversion/branches/file-handle-cache/subversion/include/private/svn_file_handle_cache.h
 (original)
+++ 
subversion/branches/file-handle-cache/subversion/include/private/svn_file_handle_cache.h
 Fri Oct 28 23:12:03 2011
@@ -20,7 +20,7 @@
  * ====================================================================
  * @endcopyright
  *
- * @file svn_file_handle_cache.h
+ * @file svn__file_handle_cache.h
  * @brief File handle cache API
  */
 
@@ -30,14 +30,14 @@
 /**
  * An opaque structure representing a cache for open file handles.
  */
-typedef struct svn_file_handle_cache_t svn_file_handle_cache_t;
+typedef struct svn__file_handle_cache_t svn__file_handle_cache_t;
 
 /**
  * An opaque structure representing a cached file handle being used
  * by the calling application.
  */
 typedef
-struct svn_file_handle_cache__handle_t svn_file_handle_cache__handle_t;
+struct svn__file_handle_cache__handle_t svn__file_handle_cache__handle_t;
 
 /**
  * Get an open file handle in @a f, for the file named @a fname with the
@@ -51,14 +51,14 @@ struct svn_file_handle_cache__handle_t s
  * returned is undefined.
  */
 svn_error_t *
-svn_file_handle_cache__open(svn_file_handle_cache__handle_t **f,
-                            svn_file_handle_cache_t *cache,
-                            const char *fname,
-                            apr_int32_t flag,
-                            apr_fileperms_t perm,
-                            apr_off_t offset,
-                            int cookie,
-                            apr_pool_t *pool);
+svn__file_handle_cache__open(svn__file_handle_cache__handle_t **f,
+                             svn__file_handle_cache_t *cache,
+                             const char *fname,
+                             apr_int32_t flag,
+                             apr_fileperms_t perm,
+                             apr_off_t offset,
+                             int cookie,
+                             apr_pool_t *pool);
 
 /**
  * Efficiently check whether the file handle cache @a cache holds an open 
@@ -67,8 +67,8 @@ svn_file_handle_cache__open(svn_file_han
  * that the respective file does not exist.
  */
 svn_boolean_t
-svn_file_handle_cache__has_file(svn_file_handle_cache_t *cache,
-                                const char *fname);
+svn__file_handle_cache__has_file(svn__file_handle_cache_t *cache,
+                                 const char *fname);
 
 /**
  * Return the APR level file handle underlying the cache file handle @a f.
@@ -76,7 +76,7 @@ svn_file_handle_cache__has_file(svn_file
  * invalidated.
  */
 apr_file_t *
-svn_file_handle_cache__get_apr_handle(svn_file_handle_cache__handle_t *f);
+svn__file_handle_cache__get_apr_handle(svn__file_handle_cache__handle_t *f);
 
 /**
  * Return the name of the file that the cached handle @a f refers to.
@@ -84,7 +84,7 @@ svn_file_handle_cache__get_apr_handle(sv
  * invalidated.
  */
 const char *
-svn_file_handle_cache__get_name(svn_file_handle_cache__handle_t *f);
+svn__file_handle_cache__get_name(svn__file_handle_cache__handle_t *f);
 
 /**
  * Return the cached file handle @a f to the cache. Depending on the number
@@ -92,13 +92,13 @@ svn_file_handle_cache__get_name(svn_file
  * is NULL, already closed or an invalidated handle, this is a no-op.
  */
 svn_error_t *
-svn_file_handle_cache__close(svn_file_handle_cache__handle_t *f);
+svn__file_handle_cache__close(svn__file_handle_cache__handle_t *f);
 
 /**
  * Close all file handles currently not held by the application.
  */
 svn_error_t *
-svn_file_handle_cache__flush(svn_file_handle_cache_t *cache);
+svn__file_handle_cache__flush(svn__file_handle_cache_t *cache);
 
 /**
  * Creates a new file handle cache in @a cache. Up to @a max_handles
@@ -109,7 +109,7 @@ svn_file_handle_cache__flush(svn_file_ha
  * cache, @a thread_safe may be @c FALSE. Otherwise, it must be @c TRUE.
  */
 svn_error_t *
-svn_file_handle_cache__create_cache(svn_file_handle_cache_t **cache,
-                                    size_t max_handles,
-                                    svn_boolean_t thread_safe,
-                                    apr_pool_t *pool);
+svn__file_handle_cache__create_cache(svn__file_handle_cache_t **cache,
+                                     size_t max_handles,
+                                     svn_boolean_t thread_safe,
+                                     apr_pool_t *pool);

Propchange: 
subversion/branches/file-handle-cache/subversion/include/private/svn_file_handle_cache.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 28 23:12:03 2011
@@ -0,0 +1 @@
+/subversion/branches/performance/subversion/include/private/svn_file_handle_cache.h:981665

Modified: 
subversion/branches/file-handle-cache/subversion/include/private/svn_temp_serializer.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/file-handle-cache/subversion/include/private/svn_temp_serializer.h?rev=1190664&r1=1190663&r2=1190664&view=diff
==============================================================================
--- 
subversion/branches/file-handle-cache/subversion/include/private/svn_temp_serializer.h
 (original)
+++ 
subversion/branches/file-handle-cache/subversion/include/private/svn_temp_serializer.h
 Fri Oct 28 23:12:03 2011
@@ -45,7 +45,8 @@ struct svn_stringbuf_t;
  * Opaque structure controlling the serialization process and holding the
  * intermediate as well as final results.
  */
-typedef struct svn_temp_serializer__context_t svn_temp_serializer__context_t;
+typedef
+struct svn__temp_serializer__context_t svn__temp_serializer__context_t;
 
 /**
  * Begin the serialization process for the @a source_struct and all objects
@@ -70,11 +71,11 @@ typedef struct svn_temp_serializer__cont
  *
  * @return the serization context.
  */
-svn_temp_serializer__context_t *
-svn_temp_serializer__init(const void *source_struct,
-                          apr_size_t struct_size,
-                          apr_size_t suggested_buffer_size,
-                          apr_pool_t *pool);
+svn__temp_serializer__context_t *
+svn__temp_serializer__init(const void *source_struct,
+                           apr_size_t struct_size,
+                           apr_size_t suggested_buffer_size,
+                           apr_pool_t *pool);
 
 /**
  * Continue the serialization process of the @a source_struct that has
@@ -120,9 +121,9 @@ svn_temp_serializer__init_append(void *b
  * svn_serializer__pop() to realign the serialization context.
  */
 void
-svn_temp_serializer__push(svn_temp_serializer__context_t *context,
-                          const void * const * source_struct,
-                          apr_size_t struct_size);
+svn__temp_serializer__push(svn__temp_serializer__context_t *context,
+                           const void * const * source_struct,
+                           apr_size_t struct_size);
 
 /**
  * End the serialization of the current sub-structure. The serialization
@@ -133,7 +134,7 @@ svn_temp_serializer__push(svn_temp_seria
  * of the serialization process.
  */
 void
-svn_temp_serializer__pop(svn_temp_serializer__context_t *context);
+svn__temp_serializer__pop(svn__temp_serializer__context_t *context);
 
 /**
  * Serialize a string referenced from the current structure within the
@@ -146,8 +147,8 @@ svn_temp_serializer__pop(svn_temp_serial
  * @a s will not be related to some struct.
  */
 void
-svn_temp_serializer__add_string(svn_temp_serializer__context_t *context,
-                                const char * const * s);
+svn__temp_serializer__add_string(svn__temp_serializer__context_t *context,
+                                 const char * const * s);
 
 /**
  * Set the serialized representation of the pointer @a ptr inside the
@@ -171,7 +172,7 @@ svn_temp_serializer__get_length(svn_temp
  * so far in the given serialization @a context.
  */
 struct svn_stringbuf_t *
-svn_temp_serializer__get(svn_temp_serializer__context_t *context);
+svn__temp_serializer__get(svn__temp_serializer__context_t *context);
 
 /**
  * Deserialization is straightforward: just copy the serialized buffer to
@@ -183,7 +184,7 @@ svn_temp_serializer__get(svn_temp_serial
  * the pointer to resolve in @a ptr.
  */
 void
-svn_temp_deserializer__resolve(void *buffer, void **ptr);
+svn__temp_deserializer__resolve(void *buffer, void **ptr);
 
 /**
  * Similar to svn_temp_deserializer__resolve() but instead of modifying

Modified: 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_file_handle_cache.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_file_handle_cache.c?rev=1190664&r1=1190663&r2=1190664&view=diff
==============================================================================
--- 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_file_handle_cache.c
 (original)
+++ 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_file_handle_cache.c
 Fri Oct 28 23:12:03 2011
@@ -1,5 +1,5 @@
 /*
- * svn_file_handle_cache.c: open file handle caching for Subversion
+ * svn__file_handle_cache.c: open file handle caching for Subversion
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one
@@ -67,7 +67,7 @@
  * between read-after-write, write-after-read or others.
  *
  * For similar reasons, an application may want to close all idle handles
- * explicitly, i.e. without opening new ones. svn_file_handle_cache__flush
+ * explicitly, i.e. without opening new ones. svn__file_handle_cache__flush
  * is the function to call in that case.
  */
 
@@ -129,7 +129,7 @@ struct cache_entry_t
 
   /* The cached file handle object handed out to the application.
    * If this is NULL, the entry is either idle or unused. */
-  svn_file_handle_cache__handle_t *open_handle;
+  svn__file_handle_cache__handle_t *open_handle;
 
   /* the file name. NULL for unused entries */
   const char *name;
@@ -161,7 +161,7 @@ struct cache_entry_t
 
 /* The file handle cache structure.
  */
-struct svn_file_handle_cache_t
+struct svn__file_handle_cache_t
 {
   /* all cache sub-structures are allocated from this pool */
   apr_pool_t *pool;
@@ -199,12 +199,12 @@ struct svn_file_handle_cache_t
  * either the handle has already been returned to the cache or the cache
  * itself has been destroyed already.
  */
-struct svn_file_handle_cache__handle_t
+struct svn__file_handle_cache__handle_t
 {
   /* the issuing cache. Having that element here simplifies function
    * signatures dealing with cached file handles. It also makes them
    * harder to use incorrectly. */
-  svn_file_handle_cache_t *cache;
+  svn__file_handle_cache_t *cache;
 
   /* the handle-specific information */
   cache_entry_t *entry;
@@ -213,7 +213,7 @@ struct svn_file_handle_cache__handle_t
 /* If applicable, locks CACHE's mutex. 
  */
 static svn_error_t *
-lock_cache(svn_file_handle_cache_t *cache)
+lock_cache(svn__file_handle_cache_t *cache)
 {
 #if APR_HAS_THREADS
   apr_status_t status;
@@ -231,7 +231,7 @@ lock_cache(svn_file_handle_cache_t *cach
 /* If applicable, unlocks CACHE's mutex, then returns ERR. 
  */
 static svn_error_t *
-unlock_cache(svn_file_handle_cache_t *cache, svn_error_t *err)
+unlock_cache(svn__file_handle_cache_t *cache, svn_error_t *err)
 {
 #if APR_HAS_THREADS
   apr_status_t status;
@@ -354,7 +354,7 @@ remove_from_list(entry_list_t *list, ent
  * If no such entry exists, the result is NULL.
  */
 static cache_entry_t *
-find_first(svn_file_handle_cache_t *cache, const char *name)
+find_first(svn__file_handle_cache_t *cache, const char *name)
 {
   cache_entry_t *result =
     (cache_entry_t *)apr_hash_get(cache->first_by_name,
@@ -394,7 +394,7 @@ auto_close_cached_handle(void *entry_voi
  */
 static svn_error_t *
 internal_file_open(cache_entry_t **result,
-                   svn_file_handle_cache_t *cache,
+                   svn__file_handle_cache_t *cache,
                    const char *name,
                    apr_int32_t flag,
                    apr_fileperms_t perm,
@@ -471,7 +471,7 @@ internal_file_open(cache_entry_t **resul
  * The entry will be in "unused" state afterwards.
  */
 static svn_error_t *
-internal_close_file(svn_file_handle_cache_t *cache, cache_entry_t *entry)
+internal_close_file(svn__file_handle_cache_t *cache, cache_entry_t *entry)
 {
   /* any cached file handle held by the application must have either
    * been returned or invalidated before, i.e. this entry must be "idle" */
@@ -524,14 +524,14 @@ internal_close_file(svn_file_handle_cach
 static apr_status_t
 close_handle_before_cleanup(void *handle_void)
 {
-  svn_file_handle_cache__handle_t *f = handle_void;
+  svn__file_handle_cache__handle_t *f = handle_void;
   svn_error_t *err = SVN_NO_ERROR;
 
   /* if this hasn't been done before: 
    * "close" the handle, i.e. return it to the cache 
    */
   if (f->entry)
-    err = svn_file_handle_cache__close(f);
+    err = svn__file_handle_cache__close(f);
 
   /* fully reset all members to prevent zombies doing damage */
   f->entry = NULL;
@@ -546,8 +546,8 @@ close_handle_before_cleanup(void *handle
  * is cleared or destroyed.
  */
 static svn_error_t *
-open_entry(svn_file_handle_cache__handle_t **f,
-           svn_file_handle_cache_t *cache,
+open_entry(svn__file_handle_cache__handle_t **f,
+           svn__file_handle_cache_t *cache,
            cache_entry_t *entry,
            apr_pool_t *pool)
 {
@@ -558,7 +558,7 @@ open_entry(svn_file_handle_cache__handle
   remove_from_list(&cache->idle_entries, &entry->idle_link);
 
   /* create and initialize the cached file handle structure */
-  *f = apr_palloc(pool, sizeof(svn_file_handle_cache__handle_t));
+  *f = apr_palloc(pool, sizeof(svn__file_handle_cache__handle_t));
   (*f)->cache = cache;
   (*f)->entry = entry;
   entry->open_handle = *f;
@@ -576,7 +576,7 @@ open_entry(svn_file_handle_cache__handle
  * underlying APR file handle rendering the entry "unused".
  */
 static svn_error_t *
-close_oldest_idle(svn_file_handle_cache_t *cache)
+close_oldest_idle(svn__file_handle_cache_t *cache)
 {
   return cache->idle_entries.first
     ? internal_close_file(cache, cache->idle_entries.first->item)
@@ -587,7 +587,7 @@ close_oldest_idle(svn_file_handle_cache_
  * if there is such an entry.
  */
 static svn_error_t *
-auto_close_oldest(svn_file_handle_cache_t *cache)
+auto_close_oldest(svn__file_handle_cache_t *cache)
 {
   return cache->used_entries.count > cache->max_used_count
     ? close_oldest_idle(cache)
@@ -639,14 +639,14 @@ pointer_is_closer(const cache_entry_t *e
  * is undefined.
  */
 svn_error_t *
-svn_file_handle_cache__open(svn_file_handle_cache__handle_t **f,
-                            svn_file_handle_cache_t *cache,
-                            const char *fname,
-                            apr_int32_t flag,
-                            apr_fileperms_t perm,
-                            apr_off_t offset,
-                            int cookie,
-                            apr_pool_t *pool)
+svn__file_handle_cache__open(svn__file_handle_cache__handle_t **f,
+                             svn__file_handle_cache_t *cache,
+                             const char *fname,
+                             apr_int32_t flag,
+                             apr_fileperms_t perm,
+                             apr_off_t offset,
+                             int cookie,
+                             apr_pool_t *pool)
 {
   svn_error_t *err = SVN_NO_ERROR;
   cache_entry_t *entry;
@@ -728,8 +728,8 @@ svn_file_handle_cache__open(svn_file_han
  * the respective file does not exist.
  */
 svn_boolean_t
-svn_file_handle_cache__has_file(svn_file_handle_cache_t *cache, 
-                                const char *fname)
+svn__file_handle_cache__has_file(svn__file_handle_cache_t *cache, 
+                                 const char *fname)
 {
   svn_boolean_t result = FALSE;
 
@@ -764,7 +764,7 @@ svn_file_handle_cache__has_file(svn_file
  * invalidated.
  */
 apr_file_t *
-svn_file_handle_cache__get_apr_handle(svn_file_handle_cache__handle_t *f)
+svn__file_handle_cache__get_apr_handle(svn__file_handle_cache__handle_t *f)
 {
   return (f && f->entry) ? f->entry->file : NULL;
 }
@@ -774,7 +774,7 @@ svn_file_handle_cache__get_apr_handle(sv
  * invalidated.
  */
 const char *
-svn_file_handle_cache__get_name(svn_file_handle_cache__handle_t *f)
+svn__file_handle_cache__get_name(svn__file_handle_cache__handle_t *f)
 {
   return (f && f->entry) ? f->entry->name : NULL;
 }
@@ -783,10 +783,10 @@ svn_file_handle_cache__get_name(svn_file
  * of open handles, the underlying handle may actually get closed.
  */
 svn_error_t *
-svn_file_handle_cache__close(svn_file_handle_cache__handle_t *f)
+svn__file_handle_cache__close(svn__file_handle_cache__handle_t *f)
 {
   svn_error_t *err = SVN_NO_ERROR;
-  svn_file_handle_cache_t *cache = f ? f->cache : NULL;
+  svn__file_handle_cache_t *cache = f ? f->cache : NULL;
   cache_entry_t *entry = f ? f->entry : NULL;
 
   /* no-op for closed or invalidated cached file handles */
@@ -828,7 +828,7 @@ svn_file_handle_cache__close(svn_file_ha
 /* Close all file handles currently not held by the application.
  */
 svn_error_t *
-svn_file_handle_cache__flush(svn_file_handle_cache_t *cache)
+svn__file_handle_cache__flush(svn__file_handle_cache_t *cache)
 {
   svn_error_t *err = SVN_NO_ERROR;
 
@@ -867,14 +867,14 @@ svn_file_handle_cache__flush(svn_file_ha
  * THREAD_SAFE may be FALSE. Otherwise, it must be TRUE.
  */
 svn_error_t *
-svn_file_handle_cache__create_cache(svn_file_handle_cache_t **cache,
-                                    size_t max_handles,
-                                    svn_boolean_t thread_safe,
-                                    apr_pool_t *pool)
+svn__file_handle_cache__create_cache(svn__file_handle_cache_t **cache,
+                                     size_t max_handles,
+                                     svn_boolean_t thread_safe,
+                                     apr_pool_t *pool)
 {
   /* allocate cache header */
-  svn_file_handle_cache_t *new_cache =
-      (svn_file_handle_cache_t *)apr_palloc(pool, sizeof(*new_cache));
+  svn__file_handle_cache_t *new_cache =
+      (svn__file_handle_cache_t *)apr_palloc(pool, sizeof(*new_cache));
 
   /* create sub-pool for all cache sub-structures */
   new_cache->pool = svn_pool_create(pool);

Propchange: 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_file_handle_cache.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 28 23:12:03 2011
@@ -0,0 +1 @@
+/subversion/branches/performance/subversion/libsvn_subr/svn_file_handle_cache.c:981665

Modified: 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_temp_serializer.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_temp_serializer.c?rev=1190664&r1=1190663&r2=1190664&view=diff
==============================================================================
--- 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_temp_serializer.c
 (original)
+++ 
subversion/branches/file-handle-cache/subversion/libsvn_subr/svn_temp_serializer.c
 Fri Oct 28 23:12:03 2011
@@ -58,7 +58,7 @@ typedef struct source_stack_t
 /* Serialization context info. It basically consists of the buffer holding
  * the serialized result and the stack of source structure information.
  */
-struct svn_temp_serializer__context_t
+struct svn__temp_serializer__context_t
 {
   /* allocations are made from this pool */
   apr_pool_t *pool;
@@ -77,7 +77,7 @@ struct svn_temp_serializer__context_t
  * guarantees.
  */
 static void
-align_buffer_end(svn_temp_serializer__context_t *context)
+align_buffer_end(svn__temp_serializer__context_t *context)
 {
   apr_size_t current_len = context->buffer->len;
   apr_size_t aligned_len = APR_ALIGN_DEFAULT(current_len);
@@ -95,11 +95,11 @@ align_buffer_end(svn_temp_serializer__co
  * re-allocations during the serialization process. All allocations will
  * be made from POOL.
  */
-svn_temp_serializer__context_t *
-svn_temp_serializer__init(const void *source_struct,
-                          apr_size_t struct_size,
-                          apr_size_t suggested_buffer_size,
-                          apr_pool_t *pool)
+svn__temp_serializer__context_t *
+svn__temp_serializer__init(const void *source_struct,
+                           apr_size_t struct_size,
+                           apr_size_t suggested_buffer_size,
+                           apr_pool_t *pool)
 {
   /* select a meaningful initial memory buffer capacity */
   apr_size_t init_size = suggested_buffer_size < struct_size
@@ -107,7 +107,8 @@ svn_temp_serializer__init(const void *so
                        : suggested_buffer_size;
 
   /* create the serialization context and initialize it */
-  svn_temp_serializer__context_t *context = apr_palloc(pool, sizeof(*context));
+  svn__temp_serializer__context_t *context = apr_palloc(pool,
+                                                        sizeof(*context));
   context->pool = pool;
   context->buffer = svn_stringbuf_create_ensure(init_size, pool);
 
@@ -177,16 +178,15 @@ svn_temp_serializer__init_append(void *b
  * right after this function call.
  */
 static void
-store_current_end_pointer(svn_temp_serializer__context_t *context,
+store_current_end_pointer(svn__temp_serializer__context_t *context,
                           const void * const * source_pointer)
 {
   apr_size_t ptr_offset;
   apr_size_t *target_ptr;
 
-  /* if *source_pointer is the root struct, there will be no parent structure
-   * to relate it to */
-  if (context->source == NULL)
-    return;
+  /* use the serialized pointer as a storage for the offset */
+  apr_size_t *target_string_ptr = 
+    (apr_size_t*)(context->buffer->data + offset);
 
   /* position of the serialized pointer relative to the begin of the buffer */
   ptr_offset = (const char *)source_pointer
@@ -214,9 +214,9 @@ store_current_end_pointer(svn_temp_seria
  * result of sizeof() of the actual structure.
  */
 void
-svn_temp_serializer__push(svn_temp_serializer__context_t *context,
-                          const void * const * source_struct,
-                          apr_size_t struct_size)
+svn__temp_serializer__push(svn__temp_serializer__context_t *context,
+                           const void * const * source_struct,
+                           apr_size_t struct_size)
 {
   const void *source = *source_struct;
 
@@ -248,7 +248,7 @@ svn_temp_serializer__push(svn_temp_seria
 /* Remove the lastest structure from the stack.
  */
 void
-svn_temp_serializer__pop(svn_temp_serializer__context_t *context)
+svn__temp_serializer__pop(svn__temp_serializer__context_t *context)
 {
   /* we may pop the original struct but not further */
   assert(context->source);
@@ -263,8 +263,8 @@ svn_temp_serializer__pop(svn_temp_serial
  * structure can be established.
  */
 void
-svn_temp_serializer__add_string(svn_temp_serializer__context_t *context,
-                                const char * const * s)
+svn__temp_serializer__add_string(svn__temp_serializer__context_t *context,
+                                 const char * const * s)
 {
   const char *string = *s;
 
@@ -315,7 +315,7 @@ svn_temp_serializer__get_length(svn_temp
  * the given serialization CONTEXT.
  */
 svn_stringbuf_t *
-svn_temp_serializer__get(svn_temp_serializer__context_t *context)
+svn__temp_serializer__get(svn__temp_serializer__context_t *context)
 {
   return context->buffer;
 }
@@ -324,7 +324,7 @@ svn_temp_serializer__get(svn_temp_serial
  * proper pointer value.
  */
 void
-svn_temp_deserializer__resolve(void *buffer, void **ptr)
+svn__temp_deserializer__resolve(void *buffer, void **ptr)
 {
   /* All pointers are stored as offsets to the buffer start
    * (of the respective serialized sub-struct). */


Reply via email to