Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 18650 invoked by uid 500); 6 Dec 2001 08:58:26 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 18589 invoked from network); 6 Dec 2001 08:58:25 -0000 From: "Sander Striker" To: "Sander Striker" Cc: Subject: RE: Pools rewrite [3] Date: Thu, 6 Dec 2001 10:00:20 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: Importance: Normal X-Rcpt-To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > From: Sander Striker [mailto:striker@apache.org] > Sent: 06 December 2001 09:50 > > From: Brian Pane [mailto:bpane@pacbell.net] > > Sent: 06 December 2001 07:52 > [...] > > >APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) > > >{ > > > > > .... > > > > > /* Reset the active node, get ourselves a new one and activate it. */ > > > active->first_avail = (char *)active + SIZEOF_NODE_T; > > > > > > > I think it might make debugging easier if we waited until the > > active node was freed (at pool destruction) before resetting > > its first_avail pointer. Just in case anybody ever ends up > > looking through the contents of the node list in gdb, it would > > be less confusing if the first_avail pointers of the previously > > active nodes still had meaningful values. (Maybe it would be > > cleanest to just set the first_avail pointer on a node in > > node_malloc, right before handing the recycled block to the > > caller?) > > Ah, no. I tried to handle as much as possible of the cleanup in apr_palloc. > This way, apr_pool_clear can be a lot faster than what we have in > the current pools code. The only thing that needs to be done is reset > the active node instead of resetting all the nodes. I forgot to comment on the debug aspect of the thing. I'm not comfortable with sacrificing performance* for debugging purposes. There will be pools debug code to use when people need to debug, that won't be aimed at top performance, but at being usefull for debugging purposes. *) The performance gain is in not having to walk the list of nodes in apr_pool_clear as mentioned above. Maybe this is not really a performance win, but more of a better devision of processing time. apr_pool_clear and apr_pool_destroy have less work to do, this could be why TStd is down(?). Sander