I had some need for using APR_POOL_DEBUG today and ran into a situation where pool lifetimes needed a hint using apr_pool_join(). That is all documented and fine, except that I was surprised to see, that apr_pool_join() doesn't work unless the application itself is also compiled with APR_POOL_DEBUG. I think that's not the intend, one should be able to replace the apr library against a debug one during lifetime.

So IMHO apr_pool_join() in apr has to be a noop function when APR_POOL_DEBUG is not defined, so that the function call is contained in the application.

Currently when the app is compiled without APR_POOL_DEBUG, then in apr.h we only have

#if APR_POOL_DEBUG || defined(DOXYGEN)
...
#else /* APR_POOL_DEBUG or DOXYGEN */

#ifdef apr_pool_join
#undef apr_pool_join
#endif
#define apr_pool_join(a,b)
...
#endif /* APR_POOL_DEBUG or DOXYGEN */

so apr_pool_join() would be an empty macro.

Other pool debug functions seem to share the same fate:

- apr_pool_owner_set()
- apr_pool_find()
- apr_pool_num_bytes()
- apr_pool_lock()
- and as mentioned apr_pool_join()

Any opinion on whether we should introduce empty implementations instead of empty macros for those all?

Regards,

Rainer

Reply via email to