summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/apr_pools.h22
-rw-r--r--memory/unix/apr_pools.c23
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