added a small feature to print the entire stack in memory verbose when
authorFilippo Gioachin <gioachin@illinois.edu>
Thu, 9 Sep 2004 01:02:36 +0000 (01:02 +0000)
committerFilippo Gioachin <gioachin@illinois.edu>
Thu, 9 Sep 2004 01:02:36 +0000 (01:02 +0000)
memInit>1

src/conv-core/memory-verbose.c

index e1353719b2466280f9d7732b13e1e51f7e221247..cba8f4b6ac76248a24c14997b0496bed928ba07d 100644 (file)
@@ -23,6 +23,7 @@ static void *meta_malloc(size_t size)
   void *ret=mm_malloc(size);
   if (memInit) CmiPrintf("CMI_MEMORY(%d)> malloc(%d) => %p\n",
                         CmiMyPe(),size,ret);
+  if (memInit>1) {int memBack=memInit; memInit=0; CmiPrintStackTrace(0); memInit=memBack;}
   return ret;
 }
 
@@ -30,6 +31,7 @@ static void meta_free(void *mem)
 {
   if (memInit) CmiPrintf("CMI_MEMORY(%d)> free(%p)\n",
                         CmiMyPe(),mem);
+  if (memInit>1) {int memBack=memInit; memInit=0; CmiPrintStackTrace(0); memInit=memBack;}
   mm_free(mem);
 }