From 281fce5ed72eaf6393299b08e7a46198638e82d3 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 9 Aug 2000 23:03:15 +0000 Subject: [PATCH] When tracing allocations, don't die with an assertion failure if isc_mem_setdestroycheck(mctx, ISC_FALSE) was called. Also, print the context in the trace statement. --- lib/isc/mem.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/isc/mem.c b/lib/isc/mem.c index b1df780eeb..a999dcb0a5 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.c,v 1.58 2000/08/01 01:29:34 tale Exp $ */ +/* $Id: mem.c,v 1.59 2000/08/09 23:03:15 bwelling Exp $ */ #include @@ -175,8 +175,8 @@ add_trace_entry(isc_mem_t *mctx, const void *ptr, unsigned int size unsigned int i; if (MEM_TRACE) - fprintf(stderr, "add %p size %u file %s line %u\n", - ptr, size, file, line); + fprintf(stderr, "add %p size %u file %s line %u mctx %p\n", + ptr, size, file, line, mctx); if (!MEM_RECORD) return; @@ -224,8 +224,8 @@ delete_trace_entry(isc_mem_t *mctx, const void *ptr, unsigned int size, unsigned int i; if (MEM_TRACE) - fprintf(stderr, "del %p size %u file %s line %u\n", - ptr, size, file, line); + fprintf(stderr, "del %p size %u file %s line %u mctx %p\n", + ptr, size, file, line, mctx); if (!MEM_RECORD) return; @@ -680,7 +680,8 @@ destroy(isc_mem_t *ctx) { INSIST(ISC_LIST_EMPTY(ctx->pools)); #ifdef ISC_MEM_TRACKLINES - INSIST(ISC_LIST_EMPTY(ctx->debuglist)); + if (ctx->checkfree) + INSIST(ISC_LIST_EMPTY(ctx->debuglist)); #endif INSIST(ctx->references == 0);