Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 959AE1778A for ; Wed, 8 Oct 2014 07:57:22 +0000 (UTC) Received: (qmail 37158 invoked by uid 500); 8 Oct 2014 07:57:22 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 37103 invoked by uid 500); 8 Oct 2014 07:57:22 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 37088 invoked by uid 99); 8 Oct 2014 07:57:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 07:57:21 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.111.4.25] (HELO out1-smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 07:56:55 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by gateway2.nyi.internal (Postfix) with ESMTP id B478F20324; Wed, 8 Oct 2014 03:56:53 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Wed, 08 Oct 2014 03:56:53 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= mesmtp; bh=IcbwYCdY04jvbeMjiXLvKsgUBy8=; b=Ywp2R+RnnISqNXb9Yce3h zuqR4GeY+FB9fWVVWWIZNWiWAriDUdlG77V3aew7tHy6x8I2TTlXmykARw0jGZsD i338MCi4P4TP0cszyAHS6mYxAFzDCmXy3w6SjI+GwN2JiTqQHlZ45ay8rovLmZ33 gB4Fv0WjsYbA0FtzfYTQx8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= smtpout; bh=IcbwYCdY04jvbeMjiXLvKsgUBy8=; b=BzEQGw3R33KsElG//Hiu YtGCxJ62S/6TZCxMxDcTJttMCmLZvvcuGjNVjXB9gKd1sgq1UtP9vWIyhiAU41s1 r5XBD4tQMvKhi8nIUQfWzRJjmfEvEHeSBjt9hmOd+4YWpvjt23oI+5esnByVeONI FTr5VOt1I9h6JObl/XNjtlE= X-Sasl-enc: DXp9ova7Y20rlpfq1YNA5PUJ6xdFK661tkQQSwP6NQKq 1412755013 Received: from tarsus.local2 (unknown [109.67.38.79]) by mail.messagingengine.com (Postfix) with ESMTPA id DA5ECC00006; Wed, 8 Oct 2014 03:56:52 -0400 (EDT) Date: Wed, 8 Oct 2014 07:56:50 +0000 From: Daniel Shahaf To: Alexey Neyman Cc: Subversion Development Subject: Re: Pool usage in Python bindings Message-ID: <20141008075650.GB1712@tarsus.local2> References: <2678554.1FMrfMabGH@mistral> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2678554.1FMrfMabGH@mistral> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Checked: Checked by ClamAV on apache.org Alexey Neyman wrote on Tue, Oct 07, 2014 at 17:27:09 -0700: > I have encountered a problem with Subversion's Python bindings. For example, > the following simple program does not work: Which version of the bindings? trunk? > Am I correct in assuming that the division of a single 'pool' argument > into distinct 'result_pool' and 'scratch_pool' is rather recent change > and the bindings were not updated for that? The first instances are a few years old (1.6.0 svn_wc.h has dual pools). New instances of dual pools happen when we create an entirely new public API, or when we rev a single-pool API (i.e., generally, a pre-1.6 API), in which case we make the revved API use dual pools. > Given all that, I could think of two approaches to fixing this issue. > > 1. Hackish, but simple. > > Change the call signature of the functions receiving one or two pool > arguments: make them always receive a single argument for any pools > it may have, which may be either None (meaning "use application pool"), > a pool object (which will be used for both the result and scratch > allocations) or a (result_pool, scratch_pool) tuple. > > This approach has two obvious drawbacks: first, it changes the > number of arguments on the existing interfaces (but this may not > be a bad thing, actually, given that it makes the breakage more > explicit - rather than subtly using the scratch pool as described above). > Second, it makes the argument lists for functions taking two pool > arguments not match their C counterparts. E.g., svn_stream_open_readonly > would be invoked as: > > // C > res = svn_stream_open_readonly(&stream, "path", > result_pool, scratch_pool); > > # Python > stream = core.svn_stream_open_readonly("path", \ > (result_pool, scratch_pool)) You said you had two approaches, but you only list one? Daniel (I don't have time to digest your mail fully right now, although I get the big picture.)