diff options
author | dgaudet <dgaudet@13f79535-47bb-0310-9956-ffa450edef68> | 2000-07-26 01:56:02 +0000 |
---|---|---|
committer | dgaudet <dgaudet@13f79535-47bb-0310-9956-ffa450edef68> | 2000-07-26 01:56:02 +0000 |
commit | 0e714850e088f8aa89ff0108b5b384f83f742ef6 (patch) | |
tree | 3bc4f5fc5a3789ebdd4378014f5182fbb23e89c8 /lib | |
parent | c12cacccbe72ea6bf3aab7132de09584a134bf6a (diff) | |
download | libapr-0e714850e088f8aa89ff0108b5b384f83f742ef6.tar.gz |
- fix POOL_DEBUG ... restored the ap_pool_joins that dreid removed.
- removed the apr_abort foo since every caller was passing it NULL anyway;
and this is debugging code, so i don't have any qualms about using
stderr or abort().
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60453 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apr_pools.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 8b7321bf6..1bd061a49 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -762,8 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, - int (*apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -776,16 +775,18 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, /* consider stuff on the stack to also be in the NULL pool... * XXX: there's cases where we don't want to assume this */ - APR_ABORT((stack_direction == -1 && - is_ptr_in_range(s, &ts, known_stack_point)) || - (stack_direction == 1 && - is_ptr_in_range(s, known_stack_point, &ts)), 1, apr_abort, - "Ouch! find_pool() called on pointer in a free block\n"); + if ((stack_direction == -1 && is_ptr_in_range(s, &ts, known_stack_point)) + || (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts))) { + abort(); + return NULL; + } /* search the global_block_list */ for (pb = &global_block_list; *pb; pb = &b->h.global_next) { b = *pb; if (is_ptr_in_range(s, b, b->h.endp)) { if (b->h.owning_pool == FREE_POOL) { + fprintf(stderr, + "Ouch! find_pool() called on pointer in a free block\n"); abort(); exit(1); } @@ -829,14 +830,15 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, - int (*apr_abort)(int retcode)) +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) { union block_hdr *b; /* We could handle more general cases... but this is it for now. */ - APR_ABORT(sub->parent != p, 1, apr_abort, - "pool_join: p is not a parent of sub\n"); + if (sub->parent != p) { + fprintf(stderr, "pool_join: p is not parent of sub\n"); + abort(); + } while (p->joined) { p = p->joined; } |