diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-27 03:46:15 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-27 03:46:15 +0000 |
commit | 22107c01ea7ace7dcf8ec20261abea739d8976ec (patch) | |
tree | 4eb75a28fbea57b6e47f1e9fa61d33e918e5306f /lib | |
parent | a1878b7fce6f694d99dce695e150f4e2b53bb342 (diff) | |
download | libapr-22107c01ea7ace7dcf8ec20261abea739d8976ec.tar.gz |
*) add apr_pool_get_parent() function.
*) add "recurse" parameter to apr_pool_num_bytes() function.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apr_pools.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 4763b447e..7d34df7ff 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -684,6 +684,11 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) 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 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) 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); |