apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c
Date Thu, 04 Jul 2002 15:04:42 GMT
striker     2002/07/04 08:04:42

  Modified:    include  apr_allocator.h
               memory/unix apr_pools.c
  Log:
  Introduce a new symbolic constant, effectively eliminating a magic
  number.
  
  Revision  Changes    Path
  1.10      +3 -0      apr/include/apr_allocator.h
  
  Index: apr_allocator.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_allocator.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- apr_allocator.h	8 Jun 2002 22:09:50 -0000	1.9
  +++ apr_allocator.h	4 Jul 2002 15:04:42 -0000	1.10
  @@ -92,6 +92,9 @@
   
   #define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
   
  +/** Symbolic constants */
  +#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
  +
   /**
    * Create a new allocator
    * @param allocator The allocator we have just created.
  
  
  
  1.180     +4 -1      apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.179
  retrieving revision 1.180
  diff -u -r1.179 -r1.180
  --- apr_pools.c	12 Jun 2002 16:45:21 -0000	1.179
  +++ apr_pools.c	4 Jul 2002 15:04:42 -0000	1.180
  @@ -119,6 +119,7 @@
           return APR_ENOMEM;
   
       memset(new_allocator, 0, SIZEOF_ALLOCATOR_T);
  +    new_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
   
       *allocator = new_allocator;
   
  @@ -351,7 +352,8 @@
           next = node->next;
           index = node->index;
   
  -        if (max_free_index != 0 && index > current_free_index) {
  +        if (max_free_index != APR_ALLOCATOR_MAX_FREE_UNLIMITED
  +            && index > current_free_index) {
               node->next = freelist;
               freelist = node;
           }
  @@ -402,6 +404,7 @@
   {
       allocator_free(allocator, node);
   }
  +
   
   
   /*
  
  
  

Mime
View raw message