[svn:parrot] r38641 - in branches/gc_api: include/parrot src/gc src/interp

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Sat May 9 13:18:21 UTC 2009


Author: whiteknight
Date: Sat May  9 13:18:21 2009
New Revision: 38641
URL: https://trac.parrot.org/parrot/changeset/38641

Log:
[gc_api] add more api functions to control access to the Arenas structure

Modified:
   branches/gc_api/include/parrot/gc_api.h
   branches/gc_api/src/gc/api.c
   branches/gc_api/src/interp/inter_misc.c

Modified: branches/gc_api/include/parrot/gc_api.h
==============================================================================
--- branches/gc_api/include/parrot/gc_api.h	Sat May  9 13:09:25 2009	(r38640)
+++ branches/gc_api/include/parrot/gc_api.h	Sat May  9 13:18:21 2009	(r38641)
@@ -270,6 +270,9 @@
 int Parrot_gc_count_collect_runs(PARROT_INTERP)
         __attribute__nonnull__(1);
 
+int Parrot_gc_count_lazy_mark_runs(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 int Parrot_gc_count_mark_runs(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -390,6 +393,9 @@
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_gc_count_collect_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_count_lazy_mark_runs \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_gc_count_mark_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_gc_destroy_header_pools \

Modified: branches/gc_api/src/gc/api.c
==============================================================================
--- branches/gc_api/src/gc/api.c	Sat May  9 13:09:25 2009	(r38640)
+++ branches/gc_api/src/gc/api.c	Sat May  9 13:18:21 2009	(r38641)
@@ -1197,6 +1197,8 @@
 
 =item C<int Parrot_gc_count_collect_runs(PARROT_INTERP)>
 
+=item C<int Parrot_gc_count_lazy_mark_runs(PARROT_INTERP)>
+
 =cut
 
 */
@@ -1215,6 +1217,13 @@
     return arena_base->gc_collect_runs;
 }
 
+int
+Parrot_gc_count_lazy_mark_runs(PARROT_INTERP)
+{
+    const Arenas * const arena_base = interp->arena_base;
+    return arena_base->gc_lazy_mark_runs;;
+}
+
 /*
 
 =back

Modified: branches/gc_api/src/interp/inter_misc.c
==============================================================================
--- branches/gc_api/src/interp/inter_misc.c	Sat May  9 13:09:25 2009	(r38640)
+++ branches/gc_api/src/interp/inter_misc.c	Sat May  9 13:18:21 2009	(r38641)
@@ -223,13 +223,13 @@
             ret = arena_base->memory_allocated;
             break;
         case GC_MARK_RUNS:
-            ret = arena_base->gc_mark_runs;
+            ret = Parrot_gc_count_mark_runs(interp);
             break;
         case GC_LAZY_MARK_RUNS:
-            ret = arena_base->gc_lazy_mark_runs;
+            ret = Parrot_gc_count_lazy_mark_runs(interp);
             break;
         case GC_COLLECT_RUNS:
-            ret = arena_base->gc_collect_runs;
+            ret = Parrot_gc_count_collect_runs(interp);
             break;
         case ACTIVE_PMCS:
             ret = Parrot_gc_active_pmcs(interp);


More information about the parrot-commits mailing list