Author: Whiteknight
Date: Thu Aug 14 16:27:30 2008
New Revision: 30238
Modified:
branches/gsoc_pdd09/include/parrot/dod.h
branches/gsoc_pdd09/src/gc/gc_it.c
Log:
[gsoc_pdd09] add a new diagnostic function to test for prematurely dead pmcs
Modified: branches/gsoc_pdd09/include/parrot/dod.h
==============================================================================
--- branches/gsoc_pdd09/include/parrot/dod.h (original)
+++ branches/gsoc_pdd09/include/parrot/dod.h Thu Aug 14 16:27:30 2008
@@ -309,6 +309,9 @@
__attribute__nonnull__(1);
void gc_it_trace_threaded(SHIM_INTERP);
+
+UINTVAL gc_it_pmc_dead(ARGIN(PMC *p))
+ __attribute__nonnull__(1);
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will
be lost. */
/* HEADERIZER END: src/gc/gc_it.c */
#endif
Modified: branches/gsoc_pdd09/src/gc/gc_it.c
==============================================================================
--- branches/gsoc_pdd09/src/gc/gc_it.c (original)
+++ branches/gsoc_pdd09/src/gc/gc_it.c Thu Aug 14 16:27:30 2008
@@ -1326,6 +1326,28 @@
return (UINTVAL)hdr->data.agg;
}
+/*
+
+=item C<gc_it_pmc_dead>
+
+Determines whether a given PMC has been prematurely swept.
+
+=cut
+
+*/
+
+# if GC_IT_DEBUG
+
+UINTVAL
+gc_it_pmc_dead(ARGIN(PMC * p))
+{
+ return(p->pmc_ext == (PMC *)0xdeadbeef ||
+ p->vtable == (PMC *)0xdeadbeef ||
+ PMC_pmc_val(pmc) == (PMC *)0xdeadbeef);
+}
+
+# endif
+
#endif /* PARROT_GC_IT */
/*