tamarin-debug-print-finalizers
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 153 cd96178a2e472dc6cd10443a56a3cedf9e8e1140
permissions -rw-r--r--
State as of now

diff --git a/js/tamarin/MMgc/GCAlloc.cpp b/js/tamarin/MMgc/GCAlloc.cpp
--- a/js/tamarin/MMgc/GCAlloc.cpp
+++ b/js/tamarin/MMgc/GCAlloc.cpp
@@ -42,6 +42,9 @@
 #include <stdlib.h>
 
 #include "MMgc.h"
+
+#include <typeinfo>
+#include <stdio.h>
 
 namespace MMgc
 {
@@ -443,6 +446,10 @@ start:
 					{     
 						GCFinalizable *obj = (GCFinalizedObject*)GetUserPointer(item);
 						GCAssert(*(int*)obj != 0);
+
+						fprintf(stderr, "Finalizing class %s at %p\n",
+							typeid(*obj).name(), obj);
+
 						obj->~GCFinalizable();
 						bits[i] &= ~(kFinalize<<(j*4));
 
diff --git a/js/tamarin/MMgc/GCLargeAlloc.cpp b/js/tamarin/MMgc/GCLargeAlloc.cpp
--- a/js/tamarin/MMgc/GCLargeAlloc.cpp
+++ b/js/tamarin/MMgc/GCLargeAlloc.cpp
@@ -43,6 +43,9 @@
 #include <string.h>
 
 #include "MMgc.h"
+
+#include <typeinfo>
+#include <stdio.h>
 
 namespace MMgc
 {
@@ -133,6 +136,10 @@ namespace MMgc
 				if (NeedsFinalize(b)) {
 					GCFinalizable *obj = (GCFinalizable *) item;
 					obj = (GCFinalizable *) GetUserPointer(obj);
+
+					fprintf(stderr, "Finalizing class %s at %p\n",
+						typeid(*obj).name(), obj);
+
 					obj->~GCFinalizable();
 #if defined(_DEBUG) && defined(MMGC_DRC)
 					if((b->flags & kRCObject) != 0) {