Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 43205 invoked from network); 19 May 2010 01:58:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 May 2010 01:58:38 -0000 Received: (qmail 34809 invoked by uid 500); 19 May 2010 01:58:38 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 34559 invoked by uid 500); 19 May 2010 01:58:38 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 34552 invoked by uid 99); 19 May 2010 01:58:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 May 2010 01:58:38 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [198.117.0.122] (HELO ndmsnpf02.ndc.nasa.gov) (198.117.0.122) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 May 2010 01:58:29 +0000 Received: from ndjsppt04.ndc.nasa.gov (ndjsppt04.ndc.nasa.gov [198.117.1.103]) by ndmsnpf02.ndc.nasa.gov (Postfix) with ESMTP id A3F1B1083A9; Tue, 18 May 2010 20:58:07 -0500 (CDT) Received: from ndjshub01.ndc.nasa.gov (ndjshub01-pub.ndc.nasa.gov [198.117.1.160]) by ndjsppt04.ndc.nasa.gov (8.14.3/8.14.3) with ESMTP id o4J1w793025345; Tue, 18 May 2010 20:58:07 -0500 Received: from [10.0.1.2] (64.142.82.6) by smtp01.ndc.nasa.gov (198.117.1.160) with Microsoft SMTP Server (TLS) id 8.1.393.1; Tue, 18 May 2010 20:58:06 -0500 Subject: Re: allocator and using malloc alternatives MIME-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset="us-ascii" From: Chris Knight In-Reply-To: <0CD3EB7D-FB90-469E-B046-69A53A8A3DDC@apache.org> Date: Tue, 18 May 2010 18:58:03 -0700 CC: APR Developer List Content-Transfer-Encoding: quoted-printable Message-ID: <848BEEB5-85F0-4E64-BBBD-3C581CF1B4E6@nasa.gov> References: <82967C72-7A0E-44C1-AAF7-AA866D99F87E@apache.org> <0A76B1E1-0443-46ED-B614-8ED133D7D615@nasa.gov> <0CD3EB7D-FB90-469E-B046-69A53A8A3DDC@apache.org> To: Nick Kew X-Mailer: Apple Mail (2.1078) X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-05-18_04:2010-02-06,2010-05-18,2010-05-18 signatures=0 Ah, makes sense. Yeah would be insane to change the malloc replacement = mid-stream so an alternate to create_with_allocator is nice. But you also bring up an important question; I argue that you should = only be able to do this on a top-level pool, not on a child pool...(In = other words, create_with_allocator would not take a parent pool = pointer.) On May 18, 2010, at 6:01 PM, Nick Kew wrote: > On 19 May 2010, at 00:12, Chris Knight wrote: >=20 >> Thanks, I mostly didn't want it to be part of apr_pool_create because = then you'd have to change every instance of calling apr_pool_create; >=20 > Yes of course. It would be a separate create function, = apr_pool_create_with_allocator > or something similar but less verbose, and certainly nearer = apr_pool_create_ex. >=20 >> plus most users will not need this capability so rather not have 99% = of apr_pool_create calls with 3 NULL's at the end. Also the semantics = get a little confusing in doing this at apr_pool_create; is the = apr_pool_t * allocated from the allocator_alloc_fn or via malloc()? >=20 > :-) >=20 > Surely, from the parent pool! That's only a question in a top-level = create. >=20 > --=20 > Nick Kew