diff options
author | rjung <rjung@13f79535-47bb-0310-9956-ffa450edef68> | 2019-07-17 19:07:10 +0000 |
---|---|---|
committer | rjung <rjung@13f79535-47bb-0310-9956-ffa450edef68> | 2019-07-17 19:07:10 +0000 |
commit | 1670bdef152eb5c996764ee2fb2bcb9acbf32624 (patch) | |
tree | 9b3038d18c5a30fd272fd4dbf00482b9ead41417 | |
parent | 2450064ee471fd9b074dc0027c2f71328b34f3bc (diff) | |
download | libapr-1670bdef152eb5c996764ee2fb2bcb9acbf32624.tar.gz |
Add empty stubs for APR pool functions, that are
only needed when APR_POOL_DEBUG is defined,
but can be aor should be called from app code.
Providing stubs allows the app code to stay the
same when running with or without debugging APR
lib (no need for app recompilation).
Backport of r1863217 from trunk resp. r1863234 from 1.7.x.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1863235 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/apr_pools.h | 19 | ||||
-rw-r--r-- | memory/unix/apr_pools.c | 25 |
2 files changed, 27 insertions, 17 deletions
diff --git a/include/apr_pools.h b/include/apr_pools.h index 783c9c422..eadc22773 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -754,11 +754,12 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * In this case the caller must call apr_pool_join() to indicate this * guarantee to the APR_POOL_DEBUG code. * - * These functions are only implemented when #APR_POOL_DEBUG is set. + * These functions have an empty implementation if APR is compiled + * with #APR_POOL_DEBUG not set. * * @{ */ -#if APR_POOL_DEBUG || defined(DOXYGEN) + /** * Guarantee that a subpool has the same lifetime as the parent. * @param p The parent pool @@ -792,20 +793,6 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); /* @} */ -#else /* APR_POOL_DEBUG or DOXYGEN */ - -#ifdef apr_pool_join -#undef apr_pool_join -#endif -#define apr_pool_join(a,b) - -#ifdef apr_pool_lock -#undef apr_pool_lock -#endif -#define apr_pool_lock(pool, lock) - -#endif /* APR_POOL_DEBUG or DOXYGEN */ - /** @} */ #ifdef __cplusplus diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a59d9dac2..82c7c5041 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2834,13 +2834,13 @@ static void free_proc_chain(struct process_chain *procs) } } +#if !APR_POOL_DEBUG /* * Pool creation/destruction stubs, for people who are running * mixed release/debug enviroments. */ -#if !APR_POOL_DEBUG APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *pool, apr_size_t size, const char *file_line) { @@ -2890,6 +2890,29 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); } +/* + * Other stubs, for people who are running + * mixed release/debug enviroments. + */ + +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) +{ +} + +APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem) +{ + return NULL; +} + +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) +{ + return 0; +} + +APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) +{ +} + #else /* APR_POOL_DEBUG */ #undef apr_palloc |