[PATCH] libsvn_wc (status.c) result_pool/scratch_pool

View: New views
5 Messages — Rating Filter:   Alert me  

[PATCH] libsvn_wc (status.c) result_pool/scratch_pool

by Martin Hauner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

another scratch_pool patch.

Note that there is an issue in close_directory. A result gets allocated
in the scratch_pool. I can't add a result_pool because it is a callback
implementation.

Should I do anything here?

See
http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=2400681&dsForumId=462

--
Martin

Subcommander 2.0.0 Beta 5 - http://subcommander.tigris.org
a Win32/Unix/MacOSX subversion GUI client & diff/merge tool.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2411208
[[[
Use result_pool/scratch_pool paradigm in libsvn_wc.

* subversion/libsvn_wc/status.c
  renamed all pool parameters to result_pool or scratch_pool, or split
  them into result_pool and scratch_pool depending on a functions pool
  usage.
]]]

Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c (revision 40220)
+++ subversion/libsvn_wc/status.c (working copy)
@@ -635,17 +635,17 @@
                       svn_boolean_t is_ignored,
                       svn_wc_status_func4_t status_func,
                       void *status_baton,
-                      apr_pool_t *pool)
+                      apr_pool_t *scratch_pool)
 {
   svn_wc_status2_t *statstruct;
 
   SVN_ERR(assemble_status(&statstruct, wb->db, local_abspath, entry,
                           parent_entry, path_kind, path_special, get_all,
                           is_ignored, wb->repos_locks, wb->repos_root,
-                          pool, pool));
+                          scratch_pool, scratch_pool));
 
   if (statstruct && status_func)
-    return status_func(status_baton, local_abspath, statstruct, pool);
+    return status_func(status_baton, local_abspath, statstruct, scratch_pool);
 
   return SVN_NO_ERROR;
 }
@@ -749,7 +749,7 @@
    whether it is ignored; otherwise we will only add the item if it
    does not match any of the patterns in PATTERNS.
 
-   Allocate everything in POOL.
+   Allocate everything in SCRATCH_POOL.
 */
 static svn_error_t *
 send_unversioned_item(const struct walk_status_baton *wb,
@@ -760,19 +760,20 @@
                       svn_boolean_t no_ignore,
                       svn_wc_status_func4_t status_func,
                       void *status_baton,
-                      apr_pool_t *pool)
+                      apr_pool_t *scratch_pool)
 {
   svn_boolean_t ignore, is_external;
   svn_wc_status2_t *status;
 
   ignore = svn_wc_match_ignore_list(svn_dirent_basename(local_abspath, NULL),
-                                    patterns, pool);
+                                    patterns, scratch_pool);
 
-  is_external = is_external_path(wb->externals, local_abspath, pool);
+  is_external = is_external_path(wb->externals, local_abspath, scratch_pool);
 
   SVN_ERR(assemble_status(&status, wb->db, local_abspath, NULL, NULL,
                           path_kind, path_special, FALSE, ignore,
-                          wb->repos_locks, wb->repos_root, pool, pool));
+                          wb->repos_locks, wb->repos_root,
+                          scratch_pool, scratch_pool));
 
   if (is_external)
     status->text_status = svn_wc_status_external;
@@ -784,7 +785,7 @@
   /* If we aren't ignoring it, or if it's an externals path, or it has a lock
      in the repository, pass this entry to the status func. */
   if (no_ignore || (! ignore) || is_external || status->repos_lock)
-    return (status_func)(status_baton, local_abspath, status, pool);
+    return (status_func)(status_baton, local_abspath, status, scratch_pool);
 
   return SVN_NO_ERROR;
 }
@@ -826,7 +827,7 @@
                  void *status_baton,
                  svn_cancel_func_t cancel_func,
                  void *cancel_baton,
-                 apr_pool_t *pool)
+                 apr_pool_t *scratch_pool)
 {
   if (kind == svn_node_dir)
     {
@@ -841,7 +842,7 @@
           SVN_ERR(get_dir_status(wb, local_abspath, dir_entry, NULL, ignores,
                                  depth, get_all, no_ignore, FALSE,
                                  status_func, status_baton, cancel_func,
-                                 cancel_baton, pool));
+                                 cancel_baton, scratch_pool));
         }
       else
         {
@@ -849,8 +850,8 @@
              is limiting us. Send just this directory.  */
           SVN_ERR(send_status_structure(wb, local_abspath, entry,
                                         dir_entry, kind, special, get_all,
-                                        FALSE,
-                                        status_func, status_baton, pool));
+                                        FALSE, status_func, status_baton,
+                                        scratch_pool));
         }
     }
   else
@@ -858,7 +859,7 @@
       /* File entries are ... just fine! */
       SVN_ERR(send_status_structure(wb, local_abspath, entry,
                                     dir_entry, kind, special, get_all, FALSE,
-                                    status_func, status_baton, pool));
+                                    status_func, status_baton, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -1347,7 +1348,7 @@
 
 /* Returns the URL for DB, or NULL: */
 static const char *
-find_dir_url(const struct dir_baton *db, apr_pool_t *pool)
+find_dir_url(const struct dir_baton *db, apr_pool_t *result_pool)
 {
   /* If we have no name, we're the root, return the anchor URL. */
   if (! db->name)
@@ -1365,9 +1366,9 @@
       if (status && status->entry && status->entry->url)
         return status->entry->url;
 
-      url = find_dir_url(pb, pool);
+      url = find_dir_url(pb, result_pool);
       if (url)
-        return svn_path_url_add_component2(url, db->name, pool);
+        return svn_path_url_add_component2(url, db->name, result_pool);
       else
         return NULL;
     }
@@ -1381,11 +1382,11 @@
                const char *path,
                struct edit_baton *edit_baton,
                struct dir_baton *parent_baton,
-               apr_pool_t *pool)
+               apr_pool_t *result_pool)
 {
   struct dir_baton *pb = parent_baton;
   struct edit_baton *eb = edit_baton;
-  struct dir_baton *d = apr_pcalloc(pool, sizeof(*d));
+  struct dir_baton *d = apr_pcalloc(result_pool, sizeof(*d));
   const char *local_abspath;
   const svn_wc_status2_t *status_in_parent;
 
@@ -1393,18 +1394,18 @@
 
   /* Construct the absolute path of this directory. */
   if (pb)
-    local_abspath = svn_dirent_join(eb->anchor_abspath, path, pool);
+    local_abspath = svn_dirent_join(eb->anchor_abspath, path, result_pool);
   else
     local_abspath = eb->anchor_abspath;
 
   /* Finish populating the baton members. */
   d->local_abspath = local_abspath;
-  d->name = path ? svn_dirent_basename(path, pool) : NULL;
+  d->name = path ? svn_dirent_basename(path, result_pool) : NULL;
   d->edit_baton = edit_baton;
   d->parent_baton = parent_baton;
-  d->pool = pool;
-  d->statii = apr_hash_make(pool);
-  d->url = apr_pstrdup(pool, find_dir_url(d, pool));
+  d->pool = result_pool;
+  d->statii = apr_hash_make(result_pool);
+  d->url = apr_pstrdup(result_pool, find_dir_url(d, result_pool));
   d->ood_last_cmt_rev = SVN_INVALID_REVNUM;
   d->ood_last_cmt_date = 0;
   d->ood_kind = svn_node_dir;
@@ -1464,7 +1465,7 @@
                              ignores, d->depth == svn_depth_files ?
                              svn_depth_files : svn_depth_immediates,
                              TRUE, TRUE, TRUE, hash_stash, d->statii, NULL,
-                             NULL, pool));
+                             NULL, result_pool));
 
       /* If we found a depth here, it should govern. */
       this_dir_status = apr_hash_get(d->statii, d->local_abspath,
@@ -1487,21 +1488,20 @@
 static struct file_baton *
 make_file_baton(struct dir_baton *parent_dir_baton,
                 const char *path,
-                apr_pool_t *pool)
+                apr_pool_t *result_pool)
 {
   struct dir_baton *pb = parent_dir_baton;
   struct edit_baton *eb = pb->edit_baton;
-  struct file_baton *f = apr_pcalloc(pool, sizeof(*f));
+  struct file_baton *f = apr_pcalloc(result_pool, sizeof(*f));
 
   /* Finish populating the baton members. */
-  f->local_abspath = svn_dirent_join(eb->anchor_abspath, path, pool);
+  f->local_abspath = svn_dirent_join(eb->anchor_abspath, path, result_pool);
   f->name = svn_dirent_basename(f->local_abspath, NULL);
-  f->pool = pool;
+  f->pool = result_pool;
   f->dir_baton = pb;
   f->edit_baton = eb;
-  f->url = svn_path_url_add_component2(find_dir_url(pb, pool),
-                                       f->name,
-                                       pool);
+  f->url = svn_path_url_add_component2(find_dir_url(pb, result_pool),
+                                       f->name, result_pool);
   f->ood_last_cmt_rev = SVN_INVALID_REVNUM;
   f->ood_last_cmt_date = 0;
   f->ood_kind = svn_node_file;
@@ -1599,18 +1599,18 @@
    directory itself.  Descend into subdirectories according to DEPTH.
    Also, if DIR_WAS_DELETED is set, each status that is reported
    through this function will have its repos_text_status field showing
-   a deletion.  Use POOL for all allocations. */
+   a deletion.  Use SCRATCH_POOL for all temporary allocations. */
 static svn_error_t *
 handle_statii(struct edit_baton *eb,
               const svn_wc_entry_t *dir_entry,
               apr_hash_t *statii,
               svn_boolean_t dir_was_deleted,
               svn_depth_t depth,
-              apr_pool_t *pool)
+              apr_pool_t *scratch_pool)
 {
   const apr_array_header_t *ignores = eb->ignores;
   apr_hash_index_t *hi;
-  apr_pool_t *subpool = svn_pool_create(pool);
+  apr_pool_t *subpool = svn_pool_create(scratch_pool);
   svn_wc_status_func4_t status_func = eb->status_func;
   void *status_baton = eb->status_baton;
   struct status_baton sb;
@@ -1624,7 +1624,7 @@
     }
 
   /* Loop over all the statuses still in our hash, handling each one. */
-  for (hi = apr_hash_first(pool, statii); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(scratch_pool, statii); hi; hi = apr_hash_next(hi))
     {
       const char *path = svn_apr_hash_index_key(hi);
       svn_wc_status2_t *status = svn_apr_hash_index_val(hi);
@@ -1672,7 +1672,7 @@
 static svn_error_t *
 set_target_revision(void *edit_baton,
                     svn_revnum_t target_revision,
-                    apr_pool_t *pool)
+                    apr_pool_t *scratch_pool)
 {
   struct edit_baton *eb = edit_baton;
   *(eb->target_revision) = target_revision;
@@ -1683,12 +1683,12 @@
 static svn_error_t *
 open_root(void *edit_baton,
           svn_revnum_t base_revision,
-          apr_pool_t *pool,
+          apr_pool_t *result_pool,
           void **dir_baton)
 {
   struct edit_baton *eb = edit_baton;
   eb->root_opened = TRUE;
-  return make_dir_baton(dir_baton, NULL, eb, NULL, pool);
+  return make_dir_baton(dir_baton, NULL, eb, NULL, result_pool);
 }
 
 
@@ -1696,11 +1696,12 @@
 delete_entry(const char *path,
              svn_revnum_t revision,
              void *parent_baton,
-             apr_pool_t *pool)
+             apr_pool_t *scratch_pool)
 {
   struct dir_baton *db = parent_baton;
   struct edit_baton *eb = db->edit_baton;
-  const char *local_abspath = svn_dirent_join(eb->anchor_abspath, path, pool);
+  const char *local_abspath = svn_dirent_join(eb->anchor_abspath, path,
+                                              scratch_pool);
   const svn_wc_entry_t *entry;
 
   /* Note:  when something is deleted, it's okay to tweak the
@@ -1712,11 +1713,13 @@
      versioned in this working copy, it was probably deleted via this
      working copy.  No need to report such a thing. */
   SVN_ERR(svn_wc__get_entry(&entry, eb->db, local_abspath, FALSE,
-                            svn_node_unknown, FALSE, pool, pool));
+                            svn_node_unknown, FALSE, scratch_pool,
+                            scratch_pool));
 
   SVN_ERR(tweak_statushash(db, db, TRUE, eb->db,
                            local_abspath, entry->kind == svn_node_dir,
-                           svn_wc_status_deleted, 0, revision, NULL, pool));
+                           svn_wc_status_deleted, 0, revision, NULL,
+                           scratch_pool));
 
   /* Mark the parent dir -- it lost an entry (unless that parent dir
      is the root node and we're not supposed to report on the root
@@ -1726,7 +1729,7 @@
                              db->local_abspath,
                              entry->kind == svn_node_dir,
                              svn_wc_status_modified, 0, SVN_INVALID_REVNUM,
-                             NULL, pool));
+                             NULL, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1737,14 +1740,14 @@
               void *parent_baton,
               const char *copyfrom_path,
               svn_revnum_t copyfrom_revision,
-              apr_pool_t *pool,
+              apr_pool_t *result_pool,
               void **child_baton)
 {
   struct dir_baton *pb = parent_baton;
   struct edit_baton *eb = pb->edit_baton;
   struct dir_baton *new_db;
 
-  SVN_ERR(make_dir_baton(child_baton, path, eb, pb, pool));
+  SVN_ERR(make_dir_baton(child_baton, path, eb, pb, result_pool));
 
   /* Make this dir as added. */
   new_db = *child_baton;
@@ -1761,11 +1764,11 @@
 open_directory(const char *path,
                void *parent_baton,
                svn_revnum_t base_revision,
-               apr_pool_t *pool,
+               apr_pool_t *result_pool,
                void **child_baton)
 {
   struct dir_baton *pb = parent_baton;
-  return make_dir_baton(child_baton, path, pb->edit_baton, pb, pool);
+  return make_dir_baton(child_baton, path, pb->edit_baton, pb, result_pool);
 }
 
 
@@ -1773,7 +1776,7 @@
 change_dir_prop(void *dir_baton,
                 const char *name,
                 const svn_string_t *value,
-                apr_pool_t *pool)
+                apr_pool_t *scratch_pool)
 {
   struct dir_baton *db = dir_baton;
   if (svn_wc_is_normal_prop(name))
@@ -1801,7 +1804,7 @@
 
 static svn_error_t *
 close_directory(void *dir_baton,
-                apr_pool_t *pool)
+                apr_pool_t *scratch_pool)
 {
   struct dir_baton *db = dir_baton;
   struct dir_baton *pb = db->parent_baton;
@@ -1839,7 +1842,7 @@
              ### directory lock here. */
           SVN_ERR(tweak_statushash(pb, db, TRUE, eb->db, db->local_abspath,
                                    TRUE, repos_text_status, repos_prop_status,
-                                   SVN_INVALID_REVNUM, NULL, pool));
+                                   SVN_INVALID_REVNUM, NULL, scratch_pool));
         }
       else
         {
@@ -1856,7 +1859,7 @@
               eb->anchor_status->ood_last_cmt_date = db->ood_last_cmt_date;
               eb->anchor_status->ood_kind = db->ood_kind;
               eb->anchor_status->ood_last_cmt_author =
-                apr_pstrdup(pool, db->ood_last_cmt_author);
+                apr_pstrdup(scratch_pool, db->ood_last_cmt_author);
             }
         }
     }
@@ -1878,11 +1881,11 @@
 
       /* Now do the status reporting. */
       SVN_ERR(handle_statii(eb, dir_status ? dir_status->entry : NULL,
-                            db->statii, was_deleted, db->depth, pool));
+                            db->statii, was_deleted, db->depth, scratch_pool));
       if (dir_status && svn_wc__is_sendable_status(dir_status, eb->no_ignore,
                                                   eb->get_all))
         SVN_ERR((eb->status_func)(eb->status_baton, db->local_abspath,
-                                  dir_status, pool));
+                                  dir_status, scratch_pool));
       apr_hash_set(pb->statii, db->local_abspath, APR_HASH_KEY_STRING, NULL);
     }
   else if (! pb)
@@ -1906,12 +1909,12 @@
                                          eb->get_all, eb->no_ignore, TRUE,
                                          eb->status_func, eb->status_baton,
                                          eb->cancel_func, eb->cancel_baton,
-                                         pool));
+                                         scratch_pool));
                 }
               if (svn_wc__is_sendable_status(tgt_status, eb->no_ignore,
                                              eb->get_all))
                 SVN_ERR((eb->status_func)(eb->status_baton, eb->target_abspath,
-                                          tgt_status, pool));
+                                          tgt_status, scratch_pool));
             }
         }
       else
@@ -1920,11 +1923,12 @@
              Note that our directory couldn't have been deleted,
              because it is the root of the edit drive. */
           SVN_ERR(handle_statii(eb, eb->anchor_status->entry,
-                                db->statii, FALSE, eb->default_depth, pool));
+                                db->statii, FALSE, eb->default_depth,
+                                scratch_pool));
           if (svn_wc__is_sendable_status(eb->anchor_status, eb->no_ignore,
                                          eb->get_all))
             SVN_ERR((eb->status_func)(eb->status_baton, db->local_abspath,
-                                      eb->anchor_status, pool));
+                                      eb->anchor_status, scratch_pool));
           eb->anchor_status = NULL;
         }
     }
@@ -1938,11 +1942,11 @@
          void *parent_baton,
          const char *copyfrom_path,
          svn_revnum_t copyfrom_revision,
-         apr_pool_t *pool,
+         apr_pool_t *result_pool,
          void **file_baton)
 {
   struct dir_baton *pb = parent_baton;
-  struct file_baton *new_fb = make_file_baton(pb, path, pool);
+  struct file_baton *new_fb = make_file_baton(pb, path, result_pool);
 
   /* Mark parent dir as changed */
   pb->text_changed = TRUE;
@@ -1959,11 +1963,11 @@
 open_file(const char *path,
           void *parent_baton,
           svn_revnum_t base_revision,
-          apr_pool_t *pool,
+          apr_pool_t *result_pool,
           void **file_baton)
 {
   struct dir_baton *pb = parent_baton;
-  struct file_baton *new_fb = make_file_baton(pb, path, pool);
+  struct file_baton *new_fb = make_file_baton(pb, path, result_pool);
 
   *file_baton = new_fb;
   return SVN_NO_ERROR;
@@ -1973,7 +1977,7 @@
 static svn_error_t *
 apply_textdelta(void *file_baton,
                 const char *base_checksum,
-                apr_pool_t *pool,
+                apr_pool_t *result_pool,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
 {
@@ -1994,7 +1998,7 @@
 change_file_prop(void *file_baton,
                  const char *name,
                  const svn_string_t *value,
-                 apr_pool_t *pool)
+                 apr_pool_t *scratch_pool)
 {
   struct file_baton *fb = file_baton;
   if (svn_wc_is_normal_prop(name))
@@ -2024,7 +2028,7 @@
 static svn_error_t *
 close_file(void *file_baton,
            const char *text_checksum,  /* ignored, as we receive no data */
-           apr_pool_t *pool)
+           apr_pool_t *scratch_pool)
 {
   struct file_baton *fb = file_baton;
   enum svn_wc_status_kind repos_text_status;
@@ -2044,15 +2048,15 @@
 
       if (fb->edit_baton->wb.repos_locks)
         {
-          url = find_dir_url(fb->dir_baton, pool);
+          url = find_dir_url(fb->dir_baton, scratch_pool);
           if (url)
             {
-              url = svn_path_url_add_component2(url, fb->name, pool);
+              url = svn_path_url_add_component2(url, fb->name, scratch_pool);
               repos_lock = apr_hash_get
                 (fb->edit_baton->wb.repos_locks,
                  svn_path_uri_decode(url +
                                      strlen(fb->edit_baton->wb.repos_root),
-                                     pool), APR_HASH_KEY_STRING);
+                                     scratch_pool), APR_HASH_KEY_STRING);
             }
         }
     }
@@ -2065,12 +2069,12 @@
   return tweak_statushash(fb, NULL, FALSE, fb->edit_baton->db,
                           fb->local_abspath, FALSE, repos_text_status,
                           repos_prop_status, SVN_INVALID_REVNUM, repos_lock,
-                          pool);
+                          scratch_pool);
 }
 
 static svn_error_t *
 close_edit(void *edit_baton,
-           apr_pool_t *pool)
+           apr_pool_t *scratch_pool)
 {
   struct edit_baton *eb = edit_baton;
 
@@ -2092,7 +2096,7 @@
                              eb->wb.external_baton,
                              eb->cancel_func,
                              eb->cancel_baton,
-                             pool));
+                             scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2298,12 +2302,12 @@
 svn_wc_status_set_repos_locks(void *edit_baton,
                               apr_hash_t *locks,
                               const char *repos_root,
-                              apr_pool_t *pool)
+                              apr_pool_t *result_pool)
 {
   struct edit_baton *eb = edit_baton;
 
   eb->wb.repos_locks = locks;
-  eb->wb.repos_root = apr_pstrdup(pool, repos_root);
+  eb->wb.repos_root = apr_pstrdup(result_pool, repos_root);
 
   return SVN_NO_ERROR;
 }
@@ -2312,7 +2316,7 @@
 svn_error_t *
 svn_wc_get_default_ignores(apr_array_header_t **patterns,
                            apr_hash_t *config,
-                           apr_pool_t *pool)
+                           apr_pool_t *result_pool)
 {
   svn_config_t *cfg = config ? apr_hash_get(config,
                                             SVN_CONFIG_CATEGORY_CONFIG,
@@ -2324,10 +2328,10 @@
   svn_config_get(cfg, &val, SVN_CONFIG_SECTION_MISCELLANY,
                  SVN_CONFIG_OPTION_GLOBAL_IGNORES,
                  SVN_CONFIG_DEFAULT_GLOBAL_IGNORES);
-  *patterns = apr_array_make(pool, 16, sizeof(const char *));
+  *patterns = apr_array_make(result_pool, 16, sizeof(const char *));
 
   /* Split the patterns on whitespace, and stuff them into *PATTERNS. */
-  svn_cstring_split_append(*patterns, val, "\n\r\t\v ", FALSE, pool);
+  svn_cstring_split_append(*patterns, val, "\n\r\t\v ", FALSE, result_pool);
   return SVN_NO_ERROR;
 }
 
@@ -2396,30 +2400,31 @@
 
 svn_wc_status2_t *
 svn_wc_dup_status2(const svn_wc_status2_t *orig_stat,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool)
 {
-  svn_wc_status2_t *new_stat = apr_palloc(pool, sizeof(*new_stat));
+  svn_wc_status2_t *new_stat = apr_palloc(result_pool, sizeof(*new_stat));
 
   /* Shallow copy all members. */
   *new_stat = *orig_stat;
 
   /* Now go back and dup the deep items into this pool. */
   if (orig_stat->entry)
-    new_stat->entry = svn_wc_entry_dup(orig_stat->entry, pool);
+    new_stat->entry = svn_wc_entry_dup(orig_stat->entry, result_pool);
 
   if (orig_stat->repos_lock)
-    new_stat->repos_lock = svn_lock_dup(orig_stat->repos_lock, pool);
+    new_stat->repos_lock = svn_lock_dup(orig_stat->repos_lock, result_pool);
 
   if (orig_stat->url)
-    new_stat->url = apr_pstrdup(pool, orig_stat->url);
+    new_stat->url = apr_pstrdup(result_pool, orig_stat->url);
 
   if (orig_stat->ood_last_cmt_author)
     new_stat->ood_last_cmt_author
-      = apr_pstrdup(pool, orig_stat->ood_last_cmt_author);
+      = apr_pstrdup(result_pool, orig_stat->ood_last_cmt_author);
 
   if (orig_stat->tree_conflict)
     new_stat->tree_conflict
-      = svn_wc__conflict_description_dup(orig_stat->tree_conflict, pool);
+      = svn_wc__conflict_description_dup(orig_stat->tree_conflict,
+                                         result_pool);
 
   /* Return the new hotness. */
   return new_stat;

Re: [PATCH] libsvn_wc (status.c) result_pool/scratch_pool

by Gavin Baumanis-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ping. This email has received no comments.

Gavin.


On 26/10/2009, at 05:34 , Martin Hauner wrote:

> Hi,
>
> another scratch_pool patch.
>
> Note that there is an issue in close_directory. A result gets  
> allocated
> in the scratch_pool. I can't add a result_pool because it is a  
> callback
> implementation.
>
> Should I do anything here?
>
> See
> http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=2400681&dsForumId=462
>
> --
> Martin
>
> Subcommander 2.0.0 Beta 5 - http://subcommander.tigris.org
> a Win32/Unix/MacOSX subversion GUI client & diff/merge tool.
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?
> dsForumId=462&dsMessageId=2411208<wc_status_2.patch>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413971

Re: [PATCH] libsvn_wc (status.c) result_pool/scratch_pool

by Gavin Baumanis-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have logged issue #3520:
http://subversion.tigris.org/issues/show_bug.cgi?id=3520

Gavin.


On 03/11/2009, at 10:13 , Gavin Baumanis wrote:

> Ping. This email has received no comments.
>
> Gavin.
>
>
> On 26/10/2009, at 05:34 , Martin Hauner wrote:
>
>> Hi,
>>
>> another scratch_pool patch.
>>
>> Note that there is an issue in close_directory. A result gets
>> allocated
>> in the scratch_pool. I can't add a result_pool because it is a
>> callback
>> implementation.
>>
>> Should I do anything here?
>>
>> See
>> http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=2400681&dsForumId=462
>>
>> --
>> Martin
>>
>> Subcommander 2.0.0 Beta 5 - http://subcommander.tigris.org
>> a Win32/Unix/MacOSX subversion GUI client & diff/merge tool.
>>
>> ------------------------------------------------------
>> http://subversion.tigris.org/ds/viewMessage.do?
>> dsForumId=462&dsMessageId=2411208<wc_status_2.patch>
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2413971

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415371

Re: [PATCH] libsvn_wc (status.c) result_pool/scratch_pool

by Julian Foad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gavin Baumanis wrote:
> I have logged issue #3520:
> http://subversion.tigris.org/issues/show_bug.cgi?id=3520


> > On 26/10/2009, at 05:34 , Martin Hauner wrote:
> >> another scratch_pool patch.
> >>
> >> Note that there is an issue in close_directory. A result gets allocated
> >> in the scratch_pool. I can't add a result_pool because it is a callback
> >> implementation.
> >>
> >> Should I do anything here?
> >>
> >> See
> >> http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=2400681&dsForumId=462

That looks like a bug in libsvn_wc/status.c:close_directory(), currently
line 1857:

    eb->anchor_status​->ood_last_cmt_au​thor =
      apr_pstrdup(pool, db->ood_last_cmt_author);

I don't believe it should allocate stuff in the edit baton from its
passed-in "pool". I think we need to add a pool pointer in the edit
baton, and initialize it to a pool that has the correct life time.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415797

Re: [PATCH] libsvn_wc (status.c) result_pool/scratch_pool

by Gavin Baumanis-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Martin,

Just thought I would chase up whether or not you were gong to follow-on with this patch submission and the extra information provided by Julian?
(And while I am sure you know already - you should feel at ease asking for any help that you might need.)

I only ask so that I know whether or not keep an eye on this particular thread or not.

Gavin.


On 10/11/2009, at 01:36 , Julian Foad wrote:

> Gavin Baumanis wrote:
>> I have logged issue #3520:
>> http://subversion.tigris.org/issues/show_bug.cgi?id=3520
>
>
>>> On 26/10/2009, at 05:34 , Martin Hauner wrote:
>>>> another scratch_pool patch.
>>>>
>>>> Note that there is an issue in close_directory. A result gets allocated
>>>> in the scratch_pool. I can't add a result_pool because it is a callback
>>>> implementation.
>>>>
>>>> Should I do anything here?
>>>>
>>>> See
>>>> http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=2400681&dsForumId=462
>
> That looks like a bug in libsvn_wc/status.c:close_directory(), currently
> line 1857:
>
>    eb->anchor_status​->ood_last_cmt_au​thor =
>      apr_pstrdup(pool, db->ood_last_cmt_author);
>
> I don't believe it should allocate stuff in the edit baton from its
> passed-in "pool". I think we need to add a pool pointer in the edit
> baton, and initialize it to a pool that has the correct life time.
>
> - Julian
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415797

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2416481