Skip to content

Commit c67d32e

Browse files
authored
Merge pull request #1330 from ldorau/Add_LOG_FATAL_when_memory_leaks_in_base_allocator_occurred
Add LOG_FATAL() when memory leaks in base allocator occurred
2 parents fe3b302 + 0280298 commit c67d32e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/base_alloc/base_alloc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,14 @@ void umf_ba_destroy(umf_ba_pool_t *pool) {
304304
#ifndef NDEBUG
305305
ba_debug_checks(pool);
306306
if (pool->metadata.n_allocs) {
307-
LOG_ERR("number of base allocator memory leaks: %zu",
308-
pool->metadata.n_allocs);
309-
310307
#ifdef UMF_DEVELOPER_MODE
308+
LOG_FATAL("number of base allocator memory leaks: %zu",
309+
pool->metadata.n_allocs);
311310
assert(pool->metadata.n_allocs == 0 &&
312311
"memory leaks in base allocator occurred");
312+
#else
313+
LOG_ERR("number of base allocator memory leaks: %zu",
314+
pool->metadata.n_allocs);
313315
#endif
314316
}
315317
#endif /* NDEBUG */

0 commit comments

Comments
 (0)