Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 76602 invoked from network); 17 Oct 2007 04:15:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Oct 2007 04:15:09 -0000 Received: (qmail 37654 invoked by uid 500); 17 Oct 2007 04:14:57 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 37628 invoked by uid 500); 17 Oct 2007 04:14:57 -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 37617 invoked by uid 99); 17 Oct 2007 04:14:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2007 21:14:57 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 04:15:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B0C781A9832; Tue, 16 Oct 2007 21:14:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r585357 - /apr/apr/trunk/memory/unix/apr_pools.c Date: Wed, 17 Oct 2007 04:14:39 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071017041439.B0C781A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Tue Oct 16 21:14:34 2007 New Revision: 585357 URL: http://svn.apache.org/viewvc?rev=585357&view=rev Log: Complete commit 488084; not only the documentation, but detection of underflow! PR: 40955 Submitted by: Peter Steiner 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=585357&r1=585356&r2=585357&view=diff ============================================================================== --- apr/apr/trunk/memory/unix/apr_pools.c (original) +++ apr/apr/trunk/memory/unix/apr_pools.c Tue Oct 16 21:14:34 2007 @@ -368,7 +368,10 @@ max_index = index; } allocator->free[index] = node; - current_free_index -= index; + if (current_free_index >= index) + current_free_index -= index; + else + current_free_index = 0; } else { /* This node is too large to keep in a specific size bucket, @@ -376,7 +379,10 @@ */ node->next = allocator->free[0]; allocator->free[0] = node; - current_free_index -= index; + if (current_free_index >= index) + current_free_index -= index; + else + current_free_index = 0; } } while ((node = next) != NULL);