summaryrefslogtreecommitdiff
path: root/memory
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-08-02 03:17:29 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-08-02 03:17:29 +0000
commitfc19cfc1bf6ff6d9089f8de0fd1c8e19b68f8c34 (patch)
treef55293dae0eed07586b4d8ff105f88d7b9285398 /memory
parent8da8cf9fb3b14bf5f77a422031773fdcaead27c2 (diff)
downloadlibapr-fc19cfc1bf6ff6d9089f8de0fd1c8e19b68f8c34.tar.gz
It just won't work on win32 that way... need an .m4 test for HAVE__END
(is the _end symbol defined?) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62080 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
-rw-r--r--memory/unix/apr_pools.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 4b6e2ddf0..34ea468e6 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -985,7 +985,9 @@ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void)
/* the unix linker defines this symbol as the last byte + 1 of
* the executable... so it includes TEXT, BSS, and DATA
*/
+#ifdef HAVE__END
extern char _end;
+#endif
/* is ptr in the range [lo,hi) */
#define is_ptr_in_range(ptr, lo, hi) \
@@ -1001,16 +1003,20 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts)
union block_hdr **pb;
union block_hdr *b;
+#ifdef HAVE__END
/* short-circuit stuff which is in TEXT, BSS, or DATA */
if (is_ptr_in_range(s, 0, &_end)) {
return NULL;
}
+#endif
/* consider stuff on the stack to also be in the NULL pool...
* XXX: there's cases where we don't want to assume this
*/
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();
+#ifdef HAVE__END
+ abort();
+#endif
return NULL;
}
/* search the global_block_list */
@@ -1073,7 +1079,7 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b)
return 1;
}
#ifdef APR_POOL_DEBUG
- while (a->joined) {
+ while (a && a->joined) {
a = a->joined;
}
#endif