Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 18225 invoked by uid 6000); 8 Sep 1999 11:34:31 -0000 Received: (qmail 18208 invoked from network); 8 Sep 1999 11:34:29 -0000 Received: from fwns2d.raleigh.ibm.com (HELO fwns2.raleigh.ibm.com) (204.146.167.236) by taz.hyperreal.org with SMTP; 8 Sep 1999 11:34:29 -0000 Received: from rtpmail03.raleigh.ibm.com (rtpmail03.raleigh.ibm.com [9.37.172.47]) by fwns2.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id HAA06488 for ; Wed, 8 Sep 1999 07:34:27 -0400 Received: from chosondo.raleigh.ibm.com (chosondo.raleigh.ibm.com [9.37.73.195]) by rtpmail03.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with ESMTP id HAA31882 for ; Wed, 8 Sep 1999 07:34:27 -0400 Date: Wed, 8 Sep 1999 07:21:58 -0400 (EDT) From: Ryan Bloom To: new-httpd@apache.org Subject: Re: palloc without a pool In-Reply-To: <37D6454B.BA46408@lyra.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org I was actually expecting the programmer to think when he/she coded. Maybe that was asking too much. I was going to implement ap_free, which did the right thing, using the same rules as ap_palloc. Namely, if there is a pool pointer, do nothing, if there isn't, free the memory. However, I like Dean's suggestion, and it will get implemented in time. If anybody feels like doing it, by all means. Ryan > If ap_palloc() can take on arbitrary schemes and one of those includes a > bare malloc(), then doesn't that imply that we must always call a free? > (because we don't know of the ap_palloc used a pool or not) In other > words, just what Dean said: the abstraction seems to be destroyed. > > I'm in favor of Dean's suggestion: don't use a free. ap_palloc() always > registers a cleanup for the memory item (where the memory came from). > > *If* you can free an item and *unregister* the cleanup, then sure... a > free *could* make sense. However, I'd rather say "screw that complexity" > and make people run the cleanups if they need to free stuff. Having > pools *and* a free function would just be too annoying. People would > always ask "do I have to free this here?" > > Cheers, > -g > > -- > Greg Stein, http://www.lyra.org/ > _______________________________________________________________________ Ryan Bloom rbb@raleigh.ibm.com 4205 S Miami Blvd RTP, NC 27709 It's a beautiful sight to see good dancers doing simple steps. It's a painful sight to see beginners doing complicated patterns.