From 5b48ecff6b1223784a4a76b70f5101a9b153fb8f Mon Sep 17 00:00:00 2001 From: Lucas Schnorr Date: Sun, 22 Jan 2012 17:58:28 +0100 Subject: [PATCH] [trace] some checks in tracing functions --- src/instr/instr_paje.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/instr/instr_paje.c b/src/instr/instr_paje.c index 86eeadf1c6..adf490c691 100644 --- a/src/instr/instr_paje.c +++ b/src/instr/instr_paje.c @@ -268,21 +268,25 @@ static container_t recursiveGetContainer (const char *name, container_t root) container_t getContainer (const char *name) { if (name == NULL) return NULL; - return recursiveGetContainer(name, rootContainer); + return getContainerByName(name); } int knownContainerWithName (const char *name) { - if (xbt_dict_get_or_null (allContainers, name)){ - return 1; - }else{ + if (xbt_dict_get_or_null (allContainers, name) == NULL){ return 0; + }else{ + return 1; } } container_t getContainerByName (const char *name) { - return (container_t)xbt_dict_get (allContainers, name); + container_t ret = xbt_dict_get_or_null (allContainers, name); + if (ret == NULL){ + XBT_CRITICAL("container with name %s not found", name); + } + return ret; } char *getContainerIdByName (const char *name) @@ -399,6 +403,11 @@ void destroyAllContainers () if (getRootType()) recursiveDestroyType (getRootType()); rootContainer = NULL; rootType = NULL; + + //checks + if (xbt_dict_length(allContainers) != 0){ + XBT_CRITICAL("some containers still present even after destroying all of them"); + } } -- 2.20.1