apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c
Date Mon, 01 Apr 2002 05:42:38 GMT
jwoolley    02/03/31 21:42:38

  Modified:    include  apr_allocator.h
               memory/unix apr_pools.c
  Log:
  Minor tweaks to expose things in the apr_allocator API needed to implement
  the bucket allocator in apr-util
  
  Revision  Changes    Path
  1.3       +9 -0      apr/include/apr_allocator.h
  
  Index: apr_allocator.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_allocator.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -d -u -r1.2 -r1.3
  --- apr_allocator.h	18 Mar 2002 16:24:54 -0000	1.2
  +++ apr_allocator.h	1 Apr 2002 05:42:38 -0000	1.3
  @@ -85,6 +85,15 @@
   /** the structure which holds information about the allocation */
   typedef struct apr_memnode_t apr_memnode_t;
   
  +struct apr_memnode_t {
  +    apr_memnode_t *next;
  +    apr_uint32_t   index;
  +    char          *first_avail;
  +    char          *endp;
  +};
  +
  +#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
  +
   /**
    * Create a new allocator
    * @param allocator The allocator we have just created.
  
  
  
  1.165     +5 -18     apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.164
  retrieving revision 1.165
  diff -u -d -u -r1.164 -r1.165
  --- apr_pools.c	31 Mar 2002 10:12:21 -0000	1.164
  +++ apr_pools.c	1 Apr 2002 05:42:38 -0000	1.165
  @@ -77,19 +77,6 @@
   
   
   /*
  - * XXX: Memory node struct, move to private header file
  - */
  -struct apr_memnode_t {
  -    apr_memnode_t *next;
  -    apr_uint32_t   index;
  -    char          *first_avail;
  -    char          *endp;
  -};
  -
  -#define SIZEOF_MEMNODE_T APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
  -
  -
  -/*
    * Magic numbers
    */
   
  @@ -189,7 +176,7 @@
       /* Round up the block size to the next boundary, but always
        * allocate at least a certain size (MIN_ALLOC).
        */
  -    size = APR_ALIGN(size + SIZEOF_MEMNODE_T, BOUNDARY_SIZE);
  +    size = APR_ALIGN(size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE);
       if (size < MIN_ALLOC)
           size = MIN_ALLOC;
   
  @@ -247,7 +234,7 @@
   #endif /* APR_HAS_THREADS */
   
               node->next = NULL;
  -            node->first_avail = (char *)node + SIZEOF_MEMNODE_T;
  +            node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
   
               return node;
           }
  @@ -283,7 +270,7 @@
   #endif /* APR_HAS_THREADS */
   
               node->next = NULL;
  -            node->first_avail = (char *)node + SIZEOF_MEMNODE_T;
  +            node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
   
               return node;
           }
  @@ -302,7 +289,7 @@
   
       node->next = NULL;
       node->index = index;
  -    node->first_avail = (char *)node + SIZEOF_MEMNODE_T;
  +    node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
       node->endp = (char *)node + size;
   
       return node;
  @@ -721,7 +708,7 @@
           allocator = parent->allocator;
   
       if ((node = apr_allocator_alloc(allocator,
  -                                    MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) {
  +                                    MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) {
           if (abort_fn)
               abort_fn(APR_ENOMEM);
   
  
  
  

Mime
View raw message