Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 49844 invoked from network); 2 Apr 2009 16:59:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2009 16:59:04 -0000 Received: (qmail 25179 invoked by uid 500); 2 Apr 2009 16:59:04 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 25105 invoked by uid 500); 2 Apr 2009 16:59:04 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 25096 invoked by uid 99); 2 Apr 2009 16:59:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 16:59:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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, 02 Apr 2009 16:59:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BBF882388A13; Thu, 2 Apr 2009 16:58:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761344 - /apr/apr/trunk/memory/unix/apr_pools.c Date: Thu, 02 Apr 2009 16:58:40 -0000 To: commits@apr.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090402165840.BBF882388A13@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Thu Apr 2 16:58:40 2009 New Revision: 761344 URL: http://svn.apache.org/viewvc?rev=761344&view=rev Log: Both cleanup and pre_cleanup can share the same free list. Axe the free_pre_cleanups and use free_cleanups for both Modified: apr/apr/trunk/memory/unix/apr_pools.c Modified: apr/apr/trunk/memory/unix/apr_pools.c URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?rev=761344&r1=761343&r2=761344&view=diff ============================================================================== --- apr/apr/trunk/memory/unix/apr_pools.c (original) +++ apr/apr/trunk/memory/unix/apr_pools.c Thu Apr 2 16:58:40 2009 @@ -512,7 +512,6 @@ apr_os_proc_t owner_proc; #endif /* defined(NETWARE) */ cleanup_t *pre_cleanups; - cleanup_t *free_pre_cleanups; cleanup_t *final_cleanups; }; @@ -725,8 +724,6 @@ /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); pool->pre_cleanups = NULL; - free_cleanups(&pool->free_pre_cleanups); - pool->free_pre_cleanups = NULL; /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. @@ -755,8 +752,6 @@ /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); pool->pre_cleanups = NULL; - free_cleanups(&pool->free_pre_cleanups); - pool->free_pre_cleanups = NULL; /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. @@ -791,7 +786,6 @@ block_list_destroy_all(pool->blocks); run_cleanups(&pool->final_cleanups); - free_cleanups(&pool->final_cleanups); block_list_destroy(&pool->final_block); free(pool); } @@ -820,7 +814,6 @@ pool->child = NULL; pool->free_cleanups = NULL; pool->pre_cleanups = NULL; - pool->free_pre_cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; pool->tag = NULL; @@ -1875,10 +1868,10 @@ #endif /* APR_POOL_DEBUG */ if (p != NULL) { - if (p->free_pre_cleanups) { + if (p->free_cleanups) { /* reuse a cleanup structure */ - c = p->free_pre_cleanups; - p->free_pre_cleanups = c->next; + c = p->free_cleanups; + p->free_cleanups = c->next; } else { c = malloc(sizeof(cleanup_t)); } @@ -1941,8 +1934,8 @@ if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { *lastp = c->next; /* move to freelist */ - c->next = p->free_pre_cleanups; - p->free_pre_cleanups = c; + c->next = p->free_cleanups; + p->free_cleanups = c; break; }