Merge branch 'ondrej/isc_loop-reference-tracking' into 'main'

Enhance the isc_loop unit to allow reference count tracking

See merge request isc-projects/bind9!7291
This commit is contained in:
Ondřej Surý 2023-01-05 12:33:19 +00:00
commit 15f2f90bda
2 changed files with 18 additions and 0 deletions

View file

@ -22,6 +22,8 @@
typedef void (*isc_job_cb)(void *);
#undef ISC_LOOP_TRACE
ISC_LANG_BEGINDECLS
void
@ -169,7 +171,19 @@ isc_loop_get(isc_loopmgr_t *loopmgr, uint32_t tid);
*\li 'tid' is smaller than number of initialized loops
*/
#
#if ISC_LOOP_TRACE
#define isc_loop_ref(ptr) isc_loop__ref(ptr, __func__, __FILE__, __LINE__)
#define isc_loop_unref(ptr) isc_loop__unref(ptr, __func__, __FILE__, __LINE__)
#define isc_loop_attach(ptr, ptrp) \
isc_loop__attach(ptr, ptrp, __func__, __FILE__, __LINE__)
#define isc_loop_detach(ptrp) \
isc_loop__detach(ptrp, __func__, __FILE__, __LINE__)
ISC_REFCOUNT_TRACE_DECL(isc_loop);
#else
ISC_REFCOUNT_DECL(isc_loop);
#endif
/*%<
* Reference counting functions for isc_loop
*/

View file

@ -330,7 +330,11 @@ loop_destroy(isc_loop_t *loop) {
UV_RUNTIME_CHECK(uv_async_send, r);
}
#if ISC_LOOP_TRACE
ISC_REFCOUNT_TRACE_IMPL(isc_loop, loop_destroy)
#else
ISC_REFCOUNT_IMPL(isc_loop, loop_destroy);
#endif
void
isc_loopmgr_create(isc_mem_t *mctx, uint32_t nloops, isc_loopmgr_t **loopmgrp) {