Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC0ECF20A for ; Thu, 28 Mar 2013 14:52:24 +0000 (UTC) Received: (qmail 31392 invoked by uid 500); 28 Mar 2013 14:51:33 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 26247 invoked by uid 500); 28 Mar 2013 14:51:24 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 22018 invoked by uid 99); 28 Mar 2013 14:48:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Mar 2013 14:48:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Mar 2013 14:48:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 412CE23889FD; Thu, 28 Mar 2013 14:48:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1462129 - /subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Date: Thu, 28 Mar 2013 14:48:21 -0000 To: commits@subversion.apache.org From: philip@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130328144821.412CE23889FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: philip Date: Thu Mar 28 14:48:20 2013 New Revision: 1462129 URL: http://svn.apache.org/r1462129 Log: * subversion/tests/libsvn_diff/diff-diff3-test.c (two_way_diff): Use a subpool to reduce the memory required to run diff-diff3-test 15. Modified: subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Modified: subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1462129&r1=1462128&r2=1462129&view=diff ============================================================================== --- subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c (original) +++ subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Thu Mar 28 14:48:20 2013 @@ -241,6 +241,12 @@ two_way_diff(const char *filename1, svn_stringbuf_t *actual; char *diff_name = apr_psprintf(pool, "diff-%s-%s", filename1, filename2); + /* Some of the tests have lots of lines, although not much data as + the lines are short, and the in-memory diffs allocate a lot of + memory. Since we are doing multiple diff in a single test we use + a subpool to reuse that memory. */ + apr_pool_t *subpool = svn_pool_create(pool); + /* We have an EXPECTED string we can match, because we don't support any other combinations (yet) than the ones above. */ svn_string_t *original = svn_string_create(contents1, pool); @@ -248,7 +254,8 @@ two_way_diff(const char *filename1, options = options ? options : svn_diff_file_options_create(pool); - SVN_ERR(svn_diff_mem_string_diff(&diff, original, modified, options, pool)); + SVN_ERR(svn_diff_mem_string_diff(&diff, original, modified, options, + subpool)); actual = svn_stringbuf_create_empty(pool); ostream = svn_stream_from_stringbuf(actual, pool); @@ -256,7 +263,8 @@ two_way_diff(const char *filename1, SVN_ERR(svn_diff_mem_string_output_unified(ostream, diff, filename1, filename2, SVN_APR_LOCALE_CHARSET, - original, modified, pool)); + original, modified, subpool)); + svn_pool_clear(subpool); SVN_ERR(svn_stream_close(ostream)); if (strcmp(actual->data, expected) != 0) return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, @@ -311,11 +319,13 @@ two_way_diff(const char *filename1, SVN_ERR(three_way_merge(filename1, filename2, filename1, contents1, contents2, contents1, contents2, NULL, svn_diff_conflict_display_modified_latest, - pool)); + subpool)); + svn_pool_clear(subpool); SVN_ERR(three_way_merge(filename2, filename1, filename2, contents2, contents1, contents2, contents1, NULL, svn_diff_conflict_display_modified_latest, - pool)); + subpool)); + svn_pool_destroy(subpool); SVN_ERR(svn_io_remove_file2(diff_name, TRUE, pool));