debug-print-finalizers
author Benjamin Smedberg <benjamin@smedbergs.us>
Sun, 20 Apr 2008 21:43:09 -0400
changeset 42 53c5098cb79e0223016b6901194a89d913f235fb
parent 20 458babdaa518471a7a2e4b09f514955c86b7c60f
permissions -rw-r--r--
Updates and imports

diff --git a/MMgc/GCAlloc.cpp b/MMgc/GCAlloc.cpp
--- a/MMgc/GCAlloc.cpp
+++ b/MMgc/GCAlloc.cpp
@@ -42,6 +42,9 @@
 
 #include "MMgc.h"
 
+#include <typeinfo>
+#include <stdio.h>
+
 namespace MMgc
 {
 	GCAlloc::GCAlloc(GC* _gc, int _itemSize, bool _containsPointers, bool _isRC, int _sizeClassIndex) : 
@@ -435,6 +438,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/MMgc/GCLargeAlloc.cpp b/MMgc/GCLargeAlloc.cpp
--- a/MMgc/GCLargeAlloc.cpp
+++ b/MMgc/GCLargeAlloc.cpp
@@ -42,6 +42,9 @@
 #include <string.h>
 
 #include "MMgc.h"
+
+#include <typeinfo>
+#include <stdio.h>
 
 namespace MMgc
 {
@@ -132,6 +135,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) {