[svn:parrot] r47216 - branches/gc_massacre/src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Mon May 31 12:19:31 UTC 2010


Author: bacek
Date: Mon May 31 12:19:31 2010
New Revision: 47216
URL: https://trac.parrot.org/parrot/changeset/47216

Log:
Add more debug to catch list brokage

Modified:
   branches/gc_massacre/src/gc/gc_tms.c
   branches/gc_massacre/src/gc/list.c
   branches/gc_massacre/src/gc/list.h

Modified: branches/gc_massacre/src/gc/gc_tms.c
==============================================================================
--- branches/gc_massacre/src/gc/gc_tms.c	Mon May 31 11:43:31 2010	(r47215)
+++ branches/gc_massacre/src/gc/gc_tms.c	Mon May 31 12:19:31 2010	(r47216)
@@ -695,14 +695,19 @@
     /* Paint live objects white */
     tmp = self->objects->first;
     counter = 0;
+    do {
+    List_Item_Header *prev;
     while (tmp) {
         PMC *pmc = LLH2Obj_typed(tmp, PMC);
+        PARROT_ASSERT(tmp->owner == self->objects);
         PARROT_ASSERT(PObj_live_TEST(pmc));
         PObj_live_CLEAR(pmc);
+        prev = tmp;
         tmp = tmp->next;
         counter++;
         PARROT_ASSERT(counter <= self->objects->count);
     }
+    } while(0);
 
     self->header_allocs_since_last_collect = 0;
     self->gc_mark_block_level--;

Modified: branches/gc_massacre/src/gc/list.c
==============================================================================
--- branches/gc_massacre/src/gc/list.c	Mon May 31 11:43:31 2010	(r47215)
+++ branches/gc_massacre/src/gc/list.c	Mon May 31 12:19:31 2010	(r47216)
@@ -66,6 +66,8 @@
         list->first = item;
 
     list->count++;
+
+    item->owner = list;
 }
 
 PARROT_EXPORT
@@ -92,6 +94,8 @@
     List_Item_Header *next = item->next;
     List_Item_Header *prev = item->prev;
 
+    PARROT_ASSERT(list == item->owner);
+
     /* First item */
     if (list->first == item)
         list->first = next;

Modified: branches/gc_massacre/src/gc/list.h
==============================================================================
--- branches/gc_massacre/src/gc/list.h	Mon May 31 11:43:31 2010	(r47215)
+++ branches/gc_massacre/src/gc/list.h	Mon May 31 12:19:31 2010	(r47216)
@@ -19,6 +19,8 @@
 typedef struct List_Item_Header {
     struct List_Item_Header *prev;
     struct List_Item_Header *next;
+
+    struct Linked_List *owner;
 } List_Item_Header;
 
 /* Double-linked list. */


More information about the parrot-commits mailing list