apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: apr/lib apr_pools.c
Date Fri, 27 Apr 2001 03:46:17 GMT
gstein      01/04/26 20:46:17

  Modified:    include  apr_pools.h
               lib      apr_pools.c
  Log:
  *) add apr_pool_get_parent() function.
  *) add "recurse" parameter to apr_pool_num_bytes() function.
  
  Revision  Changes    Path
  1.48      +11 -1     apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_pools.h,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -u -r1.47 -r1.48
  --- apr_pools.h	2001/04/26 21:28:56	1.47
  +++ apr_pools.h	2001/04/27 03:46:13	1.48
  @@ -207,11 +207,20 @@
   /**
    * Get the abort function associated with the specified pool.
    * @param pool The pool for retrieving the abort function.
  + * @return The abort function for the given pool.
    * @deffunc apr_abortfunc_t apr_pool_get_abort(apr_pool_t *pool)
    */
   APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool);
   
   /**
  + * Get the parent pool of the specified pool.
  + * @param pool The pool for retrieving the parent pool.
  + * @return The parent of the given pool.
  + * @deffunc apr_pool_t * apr_pool_get_parent(apr_pool_t *pool)
  + */
  +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool);
  +
  +/**
    * Set the data associated with the current pool
    * @param data The user data associated with the pool.
    * @param key The key to use for association
  @@ -272,9 +281,10 @@
   /**
    * Report the number of bytes currently in the pool
    * @param p The pool to inspect
  + * @param recurse Recurse/include the subpools' sizes
    * @return The number of bytes
    */
  -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p);
  +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse);
   
   /**
    * Report the number of bytes currently in the list of free blocks
  
  
  
  1.96      +14 -2     apr/lib/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/lib/apr_pools.c,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -u -r1.95 -r1.96
  --- apr_pools.c	2001/04/26 21:28:58	1.95
  +++ apr_pools.c	2001/04/27 03:46:15	1.96
  @@ -684,6 +684,11 @@
       return pool->apr_abort;
   }
   
  +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool)
  +{
  +    return pool->parent;
  +}
  +
   /*****************************************************************
    *
    * Managing generic cleanups.  
  @@ -936,10 +941,17 @@
       free_blocks(blok);
   }
   
  -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p)
  +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse)
   {
  -    return bytes_in_block_list(p->first);
  +    apr_size_t total_bytes = bytes_in_block_list(p->first);
  +
  +    if (recurse)
  +        for (p = p->sub_pools; p != NULL; p = p->sub_next)
  +            total_bytes += apr_pool_num_bytes(p, 1);
  +
  +    return total_bytes;
   }
  +
   APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void)
   {
       return bytes_in_block_list(block_freelist);
  
  
  

Mime
View raw message