[svn:parrot] r38846 - trunk/src/gc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Sat May 16 21:01:16 UTC 2009
Author: whiteknight
Date: Sat May 16 21:01:15 2009
New Revision: 38846
URL: https://trac.parrot.org/parrot/changeset/38846
Log:
[gc] move and rename trace_active_PMCs. It's a static function now
Modified:
trunk/src/gc/gc_ms.c
trunk/src/gc/gc_private.h
trunk/src/gc/mark_sweep.c
Modified: trunk/src/gc/gc_ms.c
==============================================================================
--- trunk/src/gc/gc_ms.c Sat May 16 20:57:52 2009 (r38845)
+++ trunk/src/gc/gc_ms.c Sat May 16 21:01:15 2009 (r38846)
@@ -71,6 +71,10 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*pool);
+static int gc_ms_trace_active_PMCs(PARROT_INTERP,
+ Parrot_gc_trace_type trace)
+ __attribute__nonnull__(1);
+
static int sweep_cb(PARROT_INTERP,
ARGMOD(Small_Object_Pool *pool),
int flag,
@@ -103,6 +107,8 @@
|| PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_gc_ms_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ms_trace_active_PMCs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool) \
@@ -214,7 +220,7 @@
Parrot_gc_compact_memory_pool(interp);
/* Now go trace the PMCs */
- if (trace_active_PMCs(interp, (flags & GC_trace_stack_FLAG)
+ if (gc_ms_trace_active_PMCs(interp, (flags & GC_trace_stack_FLAG)
? GC_TRACE_FULL
: GC_TRACE_ROOT_ONLY)) {
int ignored;
@@ -253,6 +259,31 @@
/*
+=item C<static int gc_ms_trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type
+trace)>
+
+Performs a full trace run and marks all the PMCs as active if they
+are. Returns whether the run completed, that is, whether it's safe
+to proceed with GC.
+
+=cut
+
+*/
+
+static int
+gc_ms_trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace)
+{
+ ASSERT_ARGS(gc_ms_trace_active_PMCs)
+ if (!Parrot_gc_trace_root(interp, trace))
+ return 0;
+
+ /* Okay, we've marked the whole root set, and should have a good-sized
+ * list of things to look at. Run through it */
+ return Parrot_gc_trace_children(interp, (size_t) -1);
+}
+
+/*
+
=item C<static int sweep_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag,
void *arg)>
Modified: trunk/src/gc/gc_private.h
==============================================================================
--- trunk/src/gc/gc_private.h Sat May 16 20:57:52 2009 (r38845)
+++ trunk/src/gc/gc_private.h Sat May 16 21:01:15 2009 (r38846)
@@ -364,9 +364,6 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-int trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace)
- __attribute__nonnull__(1);
-
#define ASSERT_ARGS_contained_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(ptr)
@@ -396,8 +393,6 @@
#define ASSERT_ARGS_Parrot_is_const_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_trace_active_PMCs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/gc/mark_sweep.c */
Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c Sat May 16 20:57:52 2009 (r38845)
+++ trunk/src/gc/mark_sweep.c Sat May 16 21:01:15 2009 (r38846)
@@ -439,31 +439,6 @@
/*
-=item C<int trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace)>
-
-Performs a full trace run and marks all the PMCs as active if they
-are. Returns whether the run completed, that is, whether it's safe
-to proceed with GC.
-
-=cut
-
-*/
-
-int
-trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace)
-{
- ASSERT_ARGS(trace_active_PMCs)
- if (!Parrot_gc_trace_root(interp, trace))
- return 0;
-
- /* Okay, we've marked the whole root set, and should have a good-sized
- * list of things to look at. Run through it */
- return Parrot_gc_trace_children(interp, (size_t) -1);
-}
-
-
-/*
-
=item C<void Parrot_gc_clear_live_bits(PARROT_INTERP, const Small_Object_Pool
*pool)>
More information about the parrot-commits
mailing list