You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/07/20 20:54:04 UTC

svn commit: r1148897 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_ra_serf/log.c

Author: hwright
Date: Wed Jul 20 18:54:03 2011
New Revision: 1148897

URL: http://svn.apache.org/viewvc?rev=1148897&view=rev
Log:
Merge r1148588 from trunk:

 * r1148588
   Use a subpool for each log item in ra_serf instead of allocating all the
   structures in the main parser pool and store a variable in the right pool.
   Justification:
     Reduces memory consumption during log processing (E.g. svn log, svn merge,
     svn mergeinfo), and provides a proper scratch pool to receivers for
     further memory usage reduction.
   Votes:
     +1: rhuijben, stsp
     +1: gstein (another iteration could make this "nicer", but is not
                 required for backport)

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_ra_serf/log.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 18:54:03 2011
@@ -53,4 +53,4 @@
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
 /subversion/branches/uris-as-urls:1060426-1064427
-/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1148071,1148374,1148566,1148853
+/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1148071,1148374,1148566,1148588,1148853

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1148897&r1=1148896&r2=1148897&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Jul 20 18:54:03 2011
@@ -74,15 +74,3 @@ Candidate changes:
 
 Approved changes:
 =================
-
- * r1148588
-   Use a subpool for each log item in ra_serf instead of allocating all the
-   structures in the main parser pool and store a variable in the right pool.
-   Justification:
-     Reduces memory consumption during log processing (E.g. svn log, svn merge,
-     svn mergeinfo), and provides a proper scratch pool to receivers for
-     further memory usage reduction.
-   Votes:
-     +1: rhuijben, stsp
-     +1: gstein (another iteration could make this "nicer", but is not
-                 required for backport)

Modified: subversion/branches/1.7.x/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_ra_serf/log.c?rev=1148897&r1=1148896&r2=1148897&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_ra_serf/log.c Wed Jul 20 18:54:03 2011
@@ -121,11 +121,12 @@ push_state(svn_ra_serf__xml_parser_t *pa
   if (state == ITEM)
     {
       log_info_t *info;
+      apr_pool_t *info_pool = svn_pool_create(parser->state->pool);
 
-      info = apr_pcalloc(parser->state->pool, sizeof(*info));
-      info->log_entry = svn_log_entry_create(parser->state->pool);
+      info = apr_pcalloc(info_pool, sizeof(*info));
+      info->pool = info_pool;
+      info->log_entry = svn_log_entry_create(info_pool);
 
-      info->pool = parser->state->pool;
       info->log_entry->revision = SVN_INVALID_REVNUM;
 
       parser->state->private = info;
@@ -220,11 +221,14 @@ start_log(svn_ra_serf__xml_parser_t *par
         }
       else if (strcmp(name.name, "revprop") == 0)
         {
+          const char *revprop_name;
           info = push_state(parser, log_ctx, REVPROP);
-          info->revprop_name = svn_xml_get_attr_value("name", attrs);
-          if (info->revprop_name == NULL)
+          revprop_name = svn_xml_get_attr_value("name", attrs);
+          if (revprop_name == NULL)
             return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
                                      _("Missing name attr in revprop element"));
+
+          info->revprop_name = apr_pstrdup(info->pool, revprop_name);
         }
       else if (strcmp(name.name, "has-children") == 0)
         {
@@ -342,6 +346,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
           log_ctx->nest_level--;
         }
 
+      svn_pool_destroy(info->pool);
       svn_ra_serf__xml_pop_state(parser);
     }
   else if (state == VERSION &&