develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r34950 - branches/pdd09gc_part1/src/gc

From:
Whiteknight
Date:
January 4, 2009 16:39
Subject:
[svn:parrot] r34950 - branches/pdd09gc_part1/src/gc
Message ID:
20090105003932.79D87CB9F9@x12.develooper.com
Author: Whiteknight
Date: Sun Jan  4 16:39:31 2009
New Revision: 34950

Modified:
   branches/pdd09gc_part1/src/gc/incremental_ms.c

Log:
[pdd09gc_part1] some small fixes and diagnostics. Current crash appears to be in the memory pool handling during string concatenation, and not part of the normal GC

Modified: branches/pdd09gc_part1/src/gc/incremental_ms.c
==============================================================================
--- branches/pdd09gc_part1/src/gc/incremental_ms.c	(original)
+++ branches/pdd09gc_part1/src/gc/incremental_ms.c	Sun Jan  4 16:39:31 2009
@@ -693,22 +693,21 @@
     PARROT_ASSERT(hdr);
     PARROT_ASSERT(obj);
 
-    if (PObj_is_PMC_TEST(obj)) {
-        if (pmc->pmc_ext) {
-            const PMC * next_for_gc = PMC_next_for_GC(pmc);
-            if (PMC_metadata(pmc))
-                pobject_lives(interp, (PObj *)PMC_metadata(pmc));
-            if (next_for_gc != pmc && next_for_gc != NULL)
-                pobject_lives(interp, (PObj *)PMC_next_for_GC(pmc));
-        }
-
-        if (pmc->real_self != pmc && pmc->real_self != NULL)
-            pobject_lives(interp, (PObj *)(pmc->real_self));
-    }
-    else if (PObj_is_string_TEST(obj)) {
-        return;
+    if (!PObj_is_PMC_TEST(obj)) return;
+    if (pmc->pmc_ext) {
+        PMC * const next_for_gc = PMC_next_for_GC(pmc);
+        if (PMC_metadata(pmc))
+            pobject_lives(interp, (PObj *)PMC_metadata(pmc));
+
+        /* I don't use next_for_gc, but some other places still do */
+        if (next_for_gc != pmc && next_for_gc != NULL)
+            pobject_lives(interp, (PObj *)PMC_next_for_GC(pmc));
     }
 
+    if (pmc->real_self != pmc && pmc->real_self != NULL)
+        pobject_lives(interp, (PObj *)(pmc->real_self));
+
+
     /* if the PMC is an array of other PMCs, we cycle through those. I'm
        surprised if this isn't covered by VTABLE_mark, but I won't question it
        now. */
@@ -718,8 +717,10 @@
     /* if it's a PMC with a custom mark routine, call that here. The
        custom mark routine will call pobject_lives on the children,
        which will add them to the queue properly. */
-    if (PObj_custom_mark_TEST(obj))
+    if (PObj_custom_mark_TEST(obj)) {
+        PObj_get_FLAGS(obj) |= PObj_custom_GC_FLAG;
         VTABLE_mark(interp, pmc);
+    }
 
     /* If the item is shared, we need to do some magic trickery with it. I
        don't know if I'm going to do said trickery here, or offload it to a



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About