You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2012/05/02 01:17:57 UTC
svn commit: r1332883 - /subversion/trunk/subversion/libsvn_delta/compat.c
Author: gstein
Date: Tue May 1 23:17:56 2012
New Revision: 1332883
URL: http://svn.apache.org/viewvc?rev=1332883&view=rev
Log:
Use a pool with a shorter lifetime for a scratch pool.
* subversion/libsvn_delta/compat.c:
(ev2_apply_textdelta): the handler pool has a defined lifetime which
is likely to be shorter than RESULT_POOL. use it as a scratch_pool.
Modified:
subversion/trunk/subversion/libsvn_delta/compat.c
Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1332883&r1=1332882&r2=1332883&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Tue May 1 23:17:56 2012
@@ -801,6 +801,8 @@ ev2_apply_textdelta(void *file_baton,
struct handler_baton *hb = apr_pcalloc(handler_pool, sizeof(*hb));
struct change_node *change;
svn_stream_t *target;
+ /* ### fix this. for now, we know this has a "short" lifetime. */
+ apr_pool_t *scratch_pool = handler_pool;
change = locate_change(fb->eb, fb->path);
SVN_ERR_ASSERT(change->contents_abspath == NULL);
@@ -812,11 +814,11 @@ ev2_apply_textdelta(void *file_baton,
hb->source = svn_stream_empty(handler_pool);
else
SVN_ERR(svn_stream_open_readonly(&hb->source, fb->delta_base, handler_pool,
- result_pool));
+ scratch_pool));
SVN_ERR(svn_stream_open_unique(&target, &change->contents_abspath, NULL,
svn_io_file_del_on_pool_cleanup,
- fb->eb->edit_pool, result_pool));
+ fb->eb->edit_pool, scratch_pool));
svn_txdelta_apply(hb->source, target,
NULL, NULL,