0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

ircd::ios: Log message for descriptor dtor leak checks.

This commit is contained in:
Jason Volk 2022-04-28 19:45:08 -07:00
parent 42c26fbbb7
commit f47b007645

View file

@ -315,17 +315,17 @@ ircd::ios::descriptor::~descriptor()
noexcept
{
if(likely(stats) && unlikely(stats->queued))
log::dwarning
log::critical
{
log, "descriptor(%p) '%s' still has %zu queued for execution.",
log, "descriptor(%p) '%s' leaking queued:%zd allocs:%zd bytes:%zd",
this,
name,
size_t(stats->queued),
ssize_t(stats->queued),
ssize_t(stats->allocs) - ssize_t(stats->frees),
ssize_t(stats->alloc_bytes) - ssize_t(stats->free_bytes),
};
// This doesn't leak if the queued object also destructs and the other
// assertions hold; the developer warning above should be sufficient.
//assert(!stats || stats->queued == 0);
assert(!stats || stats->queued == 0);
assert(!stats || stats->allocs == stats->frees);
assert(!stats || stats->alloc_bytes == stats->free_bytes);
}