apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Hyde <bh...@pobox.com>
Subject [PATCH] brigade * bucket list args
Date Fri, 21 Jan 2005 02:21:57 GMT
On Jan 20, 2005, at 5:54 PM, Cliff Woolley wrote:
> On Thu, 20 Jan 2005, Ben Hyde wrote:
>
>> Should not the second argument to apr_brigade_create be named
>> "bucket_alloc", rather than "list".
>
> It was supposed to mean "freelist".  It got its name before we came up
> with a name for the bucket allocator (cleverly named bucket_alloc).
>
> In other words, sure, go ahead, rename it.

Proof reading is NOT one of my skills.  This compiles.  But I do not
have a good regression testing framework currently.  So think - 
untested.

If you get the whim to take this patch, PLEASE proof read it carefully.

This patch changes some function parameter names, from "list" to "ba".
The parameter's changed are of type ap_bucket_alloc_t.  Once upon a
time these parameters were some kind of freelist; now they are far
more sophisticated and are certainly no longer lists.  Sadly the
fields named "list" in apr_bucket and apr_bucket_pool can't change
spelling until a major rev; so they oddly remain overloaded with the
field list in apr_bucket_brigade.


Index: include/apr_buckets.h
===================================================================
--- include/apr_buckets.h	(revision 125785)
+++ include/apr_buckets.h	(working copy)
@@ -249,8 +249,8 @@
       * @param e Pointer to the bucket being freed
       */
      void (*free)(void *e);
-    /** The freelist from which this bucket was allocated */
-    apr_bucket_alloc_t *list;
+    /** The bucket_allocator from which this bucket was allocated */
+    apr_bucket_alloc_t *list;  /* Beware, apr_bucket_brigade's list is 
different. */
  };

  /** A list of buckets */
@@ -583,7 +583,7 @@
       * bucket before continuing.
       */
      apr_pool_t *pool;
-    /** The freelist this structure was allocated from, which is
+    /** The bucket allocator this structure was allocated from, which 
is
       * needed in the cleanup phase in order to allocate space on the 
heap
       */
      apr_bucket_alloc_t *list;
@@ -651,11 +651,11 @@
   * Create a new bucket brigade.  The bucket brigade is originally 
empty.
   * @param p The pool to associate with the brigade.  Data is not 
allocated out
   *          of the pool, but a cleanup is registered.
- * @param list The bucket allocator to use
- * @return The empty bucket brigade
+ * @param ba The bucket allocator to use
+ * @return A new empty bucket brigade
   */
  APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p,
-                                                     
apr_bucket_alloc_t *list);
+                                                     
apr_bucket_alloc_t *ba);

  /**
   * destroy an entire bucket brigade.  This includes destroying all of 
the
@@ -888,7 +888,7 @@



-/*  *****  Bucket freelist functions *****  */
+/*  *****  Bucket allocator functions *****  */
  /**
   * Create a bucket allocator.
   * @param p This pool's underlying apr_allocator_t is used to allocate 
memory
@@ -916,16 +916,16 @@

  /**
   * Destroy a bucket allocator.
- * @param list The allocator to be destroyed
+ * @param ba The bucket allocator to be destroyed
   */
-APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t 
*list);
+APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t 
*ba);

  /**
   * Allocate memory for use by the buckets.
   * @param size The amount to allocate.
- * @param list The allocator from which to allocate the memory.
+ * @param ba The apr_bucket_allocator from which to allocate the 
memory.
   */
-APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, 
apr_bucket_alloc_t *list);
+APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, 
apr_bucket_alloc_t *ba);

  /**
   * Free memory previously allocated with apr_bucket_alloc().
@@ -1215,10 +1215,10 @@
  /**
   * Create an End of Stream bucket.  This indicates that there is no 
more data
   * coming from down the filter stack.  All filters should flush at 
this point.
- * @param list The freelist from which this bucket should be allocated
+ * @param ba The apr_bucket_allocator used for the new bucket.
   * @return The new bucket, or NULL if allocation failed
   */
-APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t 
*list);
+APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t 
*ba);

  /**
   * Make the bucket passed in an EOS bucket.  This indicates that there 
is no
@@ -1233,10 +1233,10 @@
   * Create a flush  bucket.  This indicates that filters should flush 
their
   * data.  There is no guarantee that they will flush it, but this is 
the
   * best we can do.
- * @param list The freelist from which this bucket should be allocated
+ * @param ba The apr_bucket_allocator used for the new bucket.
   * @return The new bucket, or NULL if allocation failed
   */
-APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t 
*list);
+APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t 
*ba);

  /**
   * Make the bucket passed in a FLUSH  bucket.  This indicates that 
filters
@@ -1251,12 +1251,12 @@
   * Create a bucket referring to long-lived data.
   * @param buf The data to insert into the bucket
   * @param nbyte The size of the data to insert.
- * @param list The freelist from which this bucket should be allocated
+ * @param ba The apr_bucket_allocator from which this bucket should be 
allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf,
                                                       apr_size_t nbyte,
-                                                     
apr_bucket_alloc_t *list);
+                                                     
apr_bucket_alloc_t *ba);

  /**
   * Make the bucket passed in a bucket refer to long-lived data
@@ -1273,12 +1273,12 @@
   * Create a bucket referring to data on the stack.
   * @param buf The data to insert into the bucket
   * @param nbyte The size of the data to insert.
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
                                                        apr_size_t nbyte,
-                                                      
apr_bucket_alloc_t *list);
+                                                      
apr_bucket_alloc_t *ba);

  /**
   * Make the bucket passed in a bucket refer to stack data
@@ -1302,13 +1302,13 @@
   * @param nbyte The size of the buffer to insert.
   * @param free_func Function to use to free the data; NULL indicates 
that the
   *                  bucket should make a copy of the data
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf,
                                                   apr_size_t nbyte,
                                                   void 
(*free_func)(void *data),
-                                                 apr_bucket_alloc_t 
*list);
+                                                 apr_bucket_alloc_t 
*ba);
  /**
   * Make the bucket passed in a bucket refer to heap data
   * @param b The bucket to make into a HEAP bucket
@@ -1328,13 +1328,13 @@
   * @param buf The buffer to insert into the bucket
   * @param length The number of bytes referred to by this bucket
   * @param pool The pool the memory was allocated from
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf,
                                                   apr_size_t length,
                                                   apr_pool_t *pool,
-                                                 apr_bucket_alloc_t 
*list);
+                                                 apr_bucket_alloc_t 
*ba);

  /**
   * Make the bucket passed in a bucket refer to pool data
@@ -1355,13 +1355,13 @@
   * @param start The offset of the first byte in the mmap
   *              that this bucket refers to
   * @param length The number of bytes referred to by this bucket
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm,
                                                   apr_off_t start,
                                                   apr_size_t length,
-                                                 apr_bucket_alloc_t 
*list);
+                                                 apr_bucket_alloc_t 
*ba);

  /**
   * Make the bucket passed in a bucket refer to an MMAP'ed file
@@ -1380,11 +1380,11 @@
  /**
   * Create a bucket referring to a socket.
   * @param thissock The socket to put in the bucket
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t 
*thissock,
-                                                   apr_bucket_alloc_t 
*list);
+                                                   apr_bucket_alloc_t 
*ba);
  /**
   * Make the bucket passed in a bucket refer to a socket
   * @param b The bucket to make into a SOCKET bucket
@@ -1397,11 +1397,11 @@
  /**
   * Create a bucket referring to a pipe.
   * @param thispipe The pipe to put in the bucket
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe,
-                                                 apr_bucket_alloc_t 
*list);
+                                                 apr_bucket_alloc_t 
*ba);

  /**
   * Make the bucket passed in a bucket refer to a pipe
@@ -1419,14 +1419,14 @@
   * @param len The amount of data in the file we are interested in
   * @param p The pool into which any needed structures should be created
   *          while reading from this file bucket
- * @param list The freelist from which this bucket should be allocated
+ * @param ba Allocator from which this bucket should be allocated
   * @return The new bucket, or NULL if allocation failed
   */
  APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd,
                                                   apr_off_t offset,
                                                   apr_size_t len,
                                                   apr_pool_t *p,
-                                                 apr_bucket_alloc_t 
*list);
+                                                 apr_bucket_alloc_t 
*ba);

  /**
   * Make the bucket passed in a bucket refer to a file
Index: buckets/apr_brigade.c
===================================================================
--- buckets/apr_brigade.c	(revision 125785)
+++ buckets/apr_brigade.c	(working copy)
@@ -53,13 +53,13 @@
  }

  APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p,
-                                                     
apr_bucket_alloc_t *list)
+                                                     
apr_bucket_alloc_t *ba)
  {
      apr_bucket_brigade *b;

      b = apr_palloc(p, sizeof(*b));
      b->p = p;
-    b->bucket_alloc = list;
+    b->bucket_alloc = ba;

      APR_RING_INIT(&b->list, apr_bucket, link);

Index: buckets/apr_buckets_heap.c
===================================================================
--- buckets/apr_buckets_heap.c	(revision 125785)
+++ buckets/apr_buckets_heap.c	(working copy)
@@ -75,13 +75,13 @@
  APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf,
                                                   apr_size_t length,
                                                   void 
(*free_func)(void *data),
-                                                 apr_bucket_alloc_t 
*list)
+                                                 apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_heap_make(b, buf, length, free_func);
  }

Index: buckets/apr_buckets_pipe.c
===================================================================
--- buckets/apr_buckets_pipe.c	(revision 125785)
+++ buckets/apr_buckets_pipe.c	(working copy)
@@ -98,13 +98,13 @@
  }

  APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *p,
-                                                 apr_bucket_alloc_t 
*list)
+                                                 apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_pipe_make(b, p);
  }

Index: buckets/apr_buckets_file.c
===================================================================
--- buckets/apr_buckets_file.c	(revision 125785)
+++ buckets/apr_buckets_file.c	(working copy)
@@ -174,13 +174,13 @@
  APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd,
                                                   apr_off_t offset,
                                                   apr_size_t len, 
apr_pool_t *p,
-                                                 apr_bucket_alloc_t 
*list)
+                                                 apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_file_make(b, fd, offset, len, p);
  }

Index: buckets/apr_buckets_flush.c
===================================================================
--- buckets/apr_buckets_flush.c	(revision 125785)
+++ buckets/apr_buckets_flush.c	(working copy)
@@ -33,13 +33,13 @@
      return b;
  }

-APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t 
*list)
+APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_flush_make(b);
  }

Index: buckets/apr_buckets_eos.c
===================================================================
--- buckets/apr_buckets_eos.c	(revision 125785)
+++ buckets/apr_buckets_eos.c	(working copy)
@@ -33,13 +33,13 @@
      return b;
  }

-APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t 
*list)
+APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_eos_make(b);
  }

Index: buckets/apr_buckets_socket.c
===================================================================
--- buckets/apr_buckets_socket.c	(revision 125785)
+++ buckets/apr_buckets_socket.c	(working copy)
@@ -93,13 +93,13 @@
  }

  APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *p,
-                                                   apr_bucket_alloc_t 
*list)
+                                                   apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_socket_make(b, p);
  }

Index: buckets/apr_buckets_simple.c
===================================================================
--- buckets/apr_buckets_simple.c	(revision 125785)
+++ buckets/apr_buckets_simple.c	(working copy)
@@ -66,13 +66,13 @@

  APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf,
                                                       apr_size_t length,
-                                                     
apr_bucket_alloc_t *list)
+                                                     
apr_bucket_alloc_t *ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_immortal_make(b, buf, length);
  }

@@ -107,13 +107,13 @@

  APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
                                                        apr_size_t 
length,
-                                                      
apr_bucket_alloc_t *list)
+                                                      
apr_bucket_alloc_t *ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_transient_make(b, buf, length);
  }

Index: buckets/apr_buckets_pool.c
===================================================================
--- buckets/apr_buckets_pool.c	(revision 125785)
+++ buckets/apr_buckets_pool.c	(working copy)
@@ -121,13 +121,13 @@
  APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf,
                                                   apr_size_t length,
                                                   apr_pool_t *pool,
-                                                 apr_bucket_alloc_t 
*list)
+                                                 apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_pool_make(b, buf, length, pool);
  }

Index: buckets/apr_buckets_mmap.c
===================================================================
--- buckets/apr_buckets_mmap.c	(revision 125785)
+++ buckets/apr_buckets_mmap.c	(working copy)
@@ -89,13 +89,13 @@
  APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm,
                                                   apr_off_t start,
                                                   apr_size_t length,
-                                                 apr_bucket_alloc_t 
*list)
+                                                 apr_bucket_alloc_t 
*ba)
  {
-    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+    apr_bucket *b = apr_bucket_alloc(sizeof(*b), ba);

      APR_BUCKET_INIT(b);
      b->free = apr_bucket_free;
-    b->list = list;
+    b->list = ba;
      return apr_bucket_mmap_make(b, mm, start, length);
  }

Index: buckets/apr_buckets_alloc.c
===================================================================
--- buckets/apr_buckets_alloc.c	(revision 125785)
+++ buckets/apr_buckets_alloc.c	(working copy)
@@ -42,16 +42,16 @@

  static apr_status_t alloc_cleanup(void *data)
  {
-    apr_bucket_alloc_t *list = data;
+    apr_bucket_alloc_t *ba = data;

-    apr_allocator_free(list->allocator, list->blocks);
+    apr_allocator_free(ba->allocator, ba->blocks);
      return APR_SUCCESS;
  }

  APU_DECLARE_NONSTD(apr_bucket_alloc_t *) 
apr_bucket_alloc_create(apr_pool_t *p)
  {
      apr_allocator_t *allocator = apr_pool_allocator_get(p);
-    apr_bucket_alloc_t *list;
+    apr_bucket_alloc_t *ba;

  #if APR_POOL_DEBUG
      /* may be NULL for debug mode. */
@@ -62,78 +62,78 @@
      }
  #endif

-    list = apr_bucket_alloc_create_ex(allocator);
-    list->pool = p;
-    apr_pool_cleanup_register(list->pool, list, alloc_cleanup,
+    ba = apr_bucket_alloc_create_ex(allocator);
+    ba->pool = p;
+    apr_pool_cleanup_register(ba->pool, ba, alloc_cleanup,
                                apr_pool_cleanup_null);

-    return list;
+    return ba;
  }

  APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(
                                               apr_allocator_t 
*allocator)
  {
-    apr_bucket_alloc_t *list;
+    apr_bucket_alloc_t *ba;
      apr_memnode_t *block;

      block = apr_allocator_alloc(allocator, ALLOC_AMT);
-    list = (apr_bucket_alloc_t *)block->first_avail;
-    list->pool = NULL;
-    list->allocator = allocator;
-    list->freelist = NULL;
-    list->blocks = block;
-    block->first_avail += APR_ALIGN_DEFAULT(sizeof(*list));
+    ba = (apr_bucket_alloc_t *)block->first_avail;
+    ba->pool = NULL;
+    ba->allocator = allocator;
+    ba->freelist = NULL;
+    ba->blocks = block;
+    block->first_avail += APR_ALIGN_DEFAULT(sizeof(*ba));

-    return list;
+    return ba;
  }

-APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t 
*list)
+APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t 
*ba)
  {
-    if (list->pool) {
-        apr_pool_cleanup_kill(list->pool, list, alloc_cleanup);
+    if (ba->pool) {
+        apr_pool_cleanup_kill(ba->pool, ba, alloc_cleanup);
      }

-    apr_allocator_free(list->allocator, list->blocks);
+    apr_allocator_free(ba->allocator, ba->blocks);

  #if APR_POOL_DEBUG
-    if (list->pool && list->allocator != 
apr_pool_allocator_get(list->pool)) {
-        apr_allocator_destroy(list->allocator);
+    if (ba->pool && ba->allocator != apr_pool_allocator_get(ba->pool)) 
{
+        apr_allocator_destroy(ba->allocator);
      }
  #endif
  }

  APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size,
-                                            apr_bucket_alloc_t *list)
+                                            apr_bucket_alloc_t *ba)
  {
      node_header_t *node;
-    apr_memnode_t *active = list->blocks;
+    apr_memnode_t *active = ba->blocks;
      char *endp;

      size += SIZEOF_NODE_HEADER_T;
      if (size <= SMALL_NODE_SIZE) {
-        if (list->freelist) {
-            node = list->freelist;
-            list->freelist = node->next;
+        if (ba->freelist) {
+            node = ba->freelist;
+            ba->freelist = node->next;
          }
          else {
              endp = active->first_avail + SMALL_NODE_SIZE;
              if (endp >= active->endp) {
-                list->blocks = apr_allocator_alloc(list->allocator, 
ALLOC_AMT);
-                list->blocks->next = active;
-                active = list->blocks;
+                ba->blocks = apr_allocator_alloc(ba->allocator, 
ALLOC_AMT);
+                ba->blocks->next = active;
+                active = ba->blocks;
                  endp = active->first_avail + SMALL_NODE_SIZE;
              }
              node = (node_header_t *)active->first_avail;
-            node->alloc = list;
+            node->alloc = ba;
              node->memnode = active;
              node->size = SMALL_NODE_SIZE;
              active->first_avail = endp;
          }
      }
      else {
-        apr_memnode_t *memnode = apr_allocator_alloc(list->allocator, 
size);
+        apr_memnode_t *memnode = apr_allocator_alloc(ba->allocator, 
size);
          node = (node_header_t *)memnode->first_avail;
-        node->alloc = list;
+        node->alloc = ba;
          node->memnode = memnode;
          node->size = size;
      }
@@ -146,8 +146,8 @@
  #endif
  static void check_not_already_free(node_header_t *node)
  {
-    apr_bucket_alloc_t *list = node->alloc;
-    node_header_t *curr = list->freelist;
+    apr_bucket_alloc_t *ba = node->alloc;
+    node_header_t *curr = ba->freelist;

      while (curr) {
          if (node == curr) {
@@ -163,14 +163,14 @@
  APU_DECLARE_NONSTD(void) apr_bucket_free(void *mem)
  {
      node_header_t *node = (node_header_t *)((char *)mem - 
SIZEOF_NODE_HEADER_T);
-    apr_bucket_alloc_t *list = node->alloc;
+    apr_bucket_alloc_t *ba = node->alloc;

      if (node->size == SMALL_NODE_SIZE) {
          check_not_already_free(node);
-        node->next = list->freelist;
-        list->freelist = node;
+        node->next = ba->freelist;
+        ba->freelist = node;
      }
      else {
-        apr_allocator_free(list->allocator, node->memnode);
+        apr_allocator_free(ba->allocator, node->memnode);
      }
  }


Mime
View raw message