From 5cc6c01f2f23b18dbbae0bf3ddb0307f5fd13263 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 19 Jan 2022 16:53:54 +0000 Subject: apr_pools: Follow up to r1863234: APR_POOL_DEBUG macros for compat. To preserve ABI, define apr_pool_{join,find,num_bytes,lock}() as no-op macros in 1.7.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1897209 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 22 +++++++++++++++++++--- memory/unix/apr_pools.c | 23 ----------------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 599ceaf74..88a59ed41 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -754,12 +754,14 @@ 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 have an empty implementation if APR is compiled - * with #APR_POOL_DEBUG not set. + * These functions are implemented when #APR_POOL_DEBUG is set and + * defined as no-op macros otherwise. * * @{ */ +#if APR_POOL_DEBUG || defined(DOXYGEN) + /** * Guarantee that a subpool has the same lifetime as the parent. * @param p The parent pool @@ -791,7 +793,21 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) */ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); -/** @} */ +#else /* APR_POOL_DEBUG or DOXYGEN */ + +#undef apr_pool_join +#define apr_pool_join(a,b) + +#undef apr_pool_find +#define apr_pool_find(mem) (NULL) + +#undef apr_pool_num_bytes +#define apr_pool_num_bytes(p, rec) ((apr_size_t)0) + +#undef apr_pool_lock +#define apr_pool_lock(pool, lock) + +#endif /* APR_POOL_DEBUG or DOXYGEN */ /** @} */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 27d0d528a..e3b84bd28 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2929,29 +2929,6 @@ 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 -- cgit v1.2.1