[svn:parrot] r43816 - branches/gc_encapsulate_part2/src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Feb 9 14:20:27 UTC 2010


Author: bacek
Date: Tue Feb  9 14:20:26 2010
New Revision: 43816
URL: https://trac.parrot.org/parrot/changeset/43816

Log:
Encapsulate mark_special. It's wrong way because we have to move whole mark_FOO_alive into gc_ms. But it's good enough for now

Modified:
   branches/gc_encapsulate_part2/src/gc/api.c
   branches/gc_encapsulate_part2/src/gc/gc_ms.c
   branches/gc_encapsulate_part2/src/gc/gc_private.h

Modified: branches/gc_encapsulate_part2/src/gc/api.c
==============================================================================
--- branches/gc_encapsulate_part2/src/gc/api.c	Tue Feb  9 14:20:07 2010	(r43815)
+++ branches/gc_encapsulate_part2/src/gc/api.c	Tue Feb  9 14:20:26 2010	(r43816)
@@ -166,7 +166,7 @@
         PMC * const p = (PMC *)obj;
 
         if (PObj_is_special_PMC_TEST(obj))
-            mark_special(interp, interp->mem_pools, p);
+            interp->gc_sys->mark_special(interp, p);
 
         else if (PMC_metadata(p))
             Parrot_gc_mark_PMC_alive(interp, PMC_metadata(p));

Modified: branches/gc_encapsulate_part2/src/gc/gc_ms.c
==============================================================================
--- branches/gc_encapsulate_part2/src/gc/gc_ms.c	Tue Feb  9 14:20:07 2010	(r43815)
+++ branches/gc_encapsulate_part2/src/gc/gc_ms.c	Tue Feb  9 14:20:26 2010	(r43816)
@@ -124,6 +124,10 @@
 static void gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags)
         __attribute__nonnull__(1);
 
+static void gc_ms_mark_special(PARROT_INTERP, ARGIN(PMC *pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
 static void gc_ms_more_traceable_objects(PARROT_INTERP,
     ARGIN(Memory_Pools *mem_pools),
     ARGMOD(Fixed_Size_Pool *pool))
@@ -240,6 +244,9 @@
        PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_gc_ms_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_gc_ms_mark_special __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_gc_ms_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(mem_pools) \
@@ -310,6 +317,7 @@
 
     interp->gc_sys->do_gc_mark              = gc_ms_mark_and_sweep;
     interp->gc_sys->compact_string_pool     = gc_ms_compact_memory_pool;
+    interp->gc_sys->mark_special            = gc_ms_mark_special;
 
     interp->gc_sys->allocate_pmc_header     = gc_ms_allocate_pmc_header;
     interp->gc_sys->free_pmc_header         = gc_ms_free_pmc_header;
@@ -485,6 +493,20 @@
 
 /*
 
+=item C<static void gc_ms_mark_special(PARROT_INTERP, PMC *pmc)>
+
+Mark PMC special.
+
+=cut
+*/
+static void
+gc_ms_mark_special(PARROT_INTERP, ARGIN(PMC *pmc))
+{
+    mark_special(interp, interp->mem_pools, pmc);
+}
+
+/*
+
 =item C<static void gc_ms_finalize_memory_pools(PARROT_INTERP, Memory_Pools *
 const mem_pools)>
 

Modified: branches/gc_encapsulate_part2/src/gc/gc_private.h
==============================================================================
--- branches/gc_encapsulate_part2/src/gc/gc_private.h	Tue Feb  9 14:20:07 2010	(r43815)
+++ branches/gc_encapsulate_part2/src/gc/gc_private.h	Tue Feb  9 14:20:26 2010	(r43816)
@@ -105,6 +105,7 @@
 
     void (*do_gc_mark)(PARROT_INTERP, UINTVAL flags);
     void (*compact_string_pool)(PARROT_INTERP);
+    void (*mark_special)(PARROT_INTERP, PMC *);
 
     void (*init_pool)(PARROT_INTERP, struct Fixed_Size_Pool *);
 


More information about the parrot-commits mailing list