diff options
author | Ryan Bloom <rbb@apache.org> | 2001-06-13 16:10:18 +0000 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2001-06-13 16:10:18 +0000 |
commit | ee0f76401b509bd5f6aecfe584a5a758b9f8bcdd (patch) | |
tree | c63b0f41be39c7fc28205962f7af24b1cb609e8c /lib | |
parent | 07e244d28be9cc0c1aef6cf4976d54f1fbda22a6 (diff) | |
download | apr-ee0f76401b509bd5f6aecfe584a5a758b9f8bcdd.tar.gz |
Make apr_pool_is_ancestor a non-debug function. This is required for
some logic that HTTPD wants to implement. I have left the join logic
in that function as debug only.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61762 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apr_pools.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 4a87c987c..e5a523b53 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -1018,26 +1018,6 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts) return NULL; } -/* return TRUE iff a is an ancestor of b - * NULL is considered an ancestor of all pools - */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) -{ - if (a == NULL) { - return 1; - } - while (a->joined) { - a = a->joined; - } - while (b) { - if (a == b) { - return 1; - } - b = b->parent; - } - return 0; -} - /* * All blocks belonging to sub will be changed to point to p * instead. This is a guarantee by the caller that sub will not @@ -1064,6 +1044,28 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) } #endif +/* return TRUE iff a is an ancestor of b + * NULL is considered an ancestor of all pools + */ +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +{ + if (a == NULL) { + return 1; + } +#ifdef APR_POOL_DEBUG + while (a->joined) { + a = a->joined; + } +#endif + while (b) { + if (a == b) { + return 1; + } + b = b->parent; + } + return 0; +} + /***************************************************************** * * Allocating stuff... |