apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r585357 - /apr/apr/trunk/memory/unix/apr_pools.c
Date Wed, 17 Oct 2007 04:14:39 GMT
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 <peter.steiner+apache hugwi.ch>

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);
 



Mime
View raw message