[svn:parrot] r38571 - in branches/gc_api: include/parrot src/gc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Fri May 8 01:15:51 UTC 2009
Author: whiteknight
Date: Fri May 8 01:15:48 2009
New Revision: 38571
URL: https://trac.parrot.org/parrot/changeset/38571
Log:
[gc_api] move a few more functions
Modified:
branches/gc_api/include/parrot/gc_api.h
branches/gc_api/include/parrot/gc_mark_sweep.h
branches/gc_api/include/parrot/resources.h
branches/gc_api/src/gc/api.c
branches/gc_api/src/gc/mark_sweep.c
branches/gc_api/src/gc/resources.c
Modified: branches/gc_api/include/parrot/gc_api.h
==============================================================================
--- branches/gc_api/include/parrot/gc_api.h Fri May 8 01:10:27 2009 (r38570)
+++ branches/gc_api/include/parrot/gc_api.h Fri May 8 01:15:48 2009 (r38571)
@@ -80,9 +80,6 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*p);
-void Parrot_gc_ms_run_init(PARROT_INTERP)
- __attribute__nonnull__(1);
-
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
void * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
@@ -98,9 +95,6 @@
STRING * Parrot_gc_new_string_header(PARROT_INTERP, UINTVAL flags)
__attribute__nonnull__(1);
-void Parrot_gc_profile_end(PARROT_INTERP, int what)
- __attribute__nonnull__(1);
-
#define ASSERT_ARGS_Parrot_do_gc_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -116,8 +110,6 @@
#define ASSERT_ARGS_Parrot_gc_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(p)
-#define ASSERT_ARGS_Parrot_gc_ms_run_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_new_bufferlike_header \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
@@ -125,8 +117,6 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_new_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_profile_end __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/api.c */
Modified: branches/gc_api/include/parrot/gc_mark_sweep.h
==============================================================================
--- branches/gc_api/include/parrot/gc_mark_sweep.h Fri May 8 01:10:27 2009 (r38570)
+++ branches/gc_api/include/parrot/gc_mark_sweep.h Fri May 8 01:15:48 2009 (r38571)
@@ -201,6 +201,9 @@
void Parrot_gc_ms_run(PARROT_INTERP, UINTVAL flags)
__attribute__nonnull__(1);
+void Parrot_gc_ms_run_init(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
void Parrot_gc_sweep(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -251,6 +254,8 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_ms_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_ms_run_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
Modified: branches/gc_api/include/parrot/resources.h
==============================================================================
--- branches/gc_api/include/parrot/resources.h Fri May 8 01:10:27 2009 (r38570)
+++ branches/gc_api/include/parrot/resources.h Fri May 8 01:15:48 2009 (r38571)
@@ -59,6 +59,9 @@
void Parrot_destroy_memory_pools(PARROT_INTERP)
__attribute__nonnull__(1);
+void Parrot_gc_profile_end(PARROT_INTERP, int what)
+ __attribute__nonnull__(1);
+
void Parrot_gc_profile_start(PARROT_INTERP)
__attribute__nonnull__(1);
@@ -104,6 +107,8 @@
|| PARROT_ASSERT_ARG(str)
#define ASSERT_ARGS_Parrot_destroy_memory_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_profile_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_profile_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_go_collect __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/gc_api/src/gc/api.c
==============================================================================
--- branches/gc_api/src/gc/api.c Fri May 8 01:10:27 2009 (r38570)
+++ branches/gc_api/src/gc/api.c Fri May 8 01:15:48 2009 (r38571)
@@ -296,63 +296,7 @@
p->pmc_ext = NULL;
}
-/*
-
-=item C<void Parrot_gc_profile_end(PARROT_INTERP, int what)>
-
-Records the end time of the GC mark run part C<what> run when profiling is
-enabled. Also record start time of next part.
-
-=cut
-
-*/
-
-void
-Parrot_gc_profile_end(PARROT_INTERP, int what)
-{
- ASSERT_ARGS(Parrot_gc_profile_end)
- if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG)) {
- RunProfile * const profile = interp->profile;
- const FLOATVAL now = Parrot_floatval_time();
-
- profile->data[what].numcalls++;
- profile->data[what].time += now - profile->gc_time;
-
- /*
- * we've recorded the time of a GC piece from
- * gc_time until now, so add this to the start of the
- * currently executing opcode, which hasn't run this
- * interval.
- */
- profile->starttime += now - profile->gc_time;
-
- /* prepare start for next step */
- profile->gc_time = now;
- }
-}
-/*
-
-=item C<void Parrot_gc_ms_run_init(PARROT_INTERP)>
-
-Prepares the collector for a mark & sweep GC run. This is the
-initializer function for the MS garbage collector.
-
-=cut
-
-*/
-
-void
-Parrot_gc_ms_run_init(PARROT_INTERP)
-{
- ASSERT_ARGS(Parrot_gc_ms_run_init)
- Arenas * const arena_base = interp->arena_base;
-
- arena_base->gc_trace_ptr = NULL;
- arena_base->gc_mark_start = NULL;
- arena_base->num_early_PMCs_seen = 0;
- arena_base->num_extended_PMCs = 0;
-}
/*
Modified: branches/gc_api/src/gc/mark_sweep.c
==============================================================================
--- branches/gc_api/src/gc/mark_sweep.c Fri May 8 01:10:27 2009 (r38570)
+++ branches/gc_api/src/gc/mark_sweep.c Fri May 8 01:15:48 2009 (r38571)
@@ -368,6 +368,30 @@
/*
+=item C<void Parrot_gc_ms_run_init(PARROT_INTERP)>
+
+Prepares the collector for a mark & sweep GC run. This is the
+initializer function for the MS garbage collector.
+
+=cut
+
+*/
+
+void
+Parrot_gc_ms_run_init(PARROT_INTERP)
+{
+ ASSERT_ARGS(Parrot_gc_ms_run_init)
+ Arenas * const arena_base = interp->arena_base;
+
+ arena_base->gc_trace_ptr = NULL;
+ arena_base->gc_mark_start = NULL;
+ arena_base->num_early_PMCs_seen = 0;
+ arena_base->num_extended_PMCs = 0;
+}
+
+
+/*
+
=item C<void Parrot_gc_ms_free_pmc(PARROT_INTERP, Small_Object_Pool *pool, PObj
*p)>
Modified: branches/gc_api/src/gc/resources.c
==============================================================================
--- branches/gc_api/src/gc/resources.c Fri May 8 01:10:27 2009 (r38570)
+++ branches/gc_api/src/gc/resources.c Fri May 8 01:15:48 2009 (r38571)
@@ -1150,6 +1150,42 @@
/*
+=item C<void Parrot_gc_profile_end(PARROT_INTERP, int what)>
+
+Records the end time of the GC mark run part C<what> run when profiling is
+enabled. Also record start time of next part.
+
+=cut
+
+*/
+
+void
+Parrot_gc_profile_end(PARROT_INTERP, int what)
+{
+ ASSERT_ARGS(Parrot_gc_profile_end)
+ if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG)) {
+ RunProfile * const profile = interp->profile;
+ const FLOATVAL now = Parrot_floatval_time();
+
+ profile->data[what].numcalls++;
+ profile->data[what].time += now - profile->gc_time;
+
+ /*
+ * we've recorded the time of a GC piece from
+ * gc_time until now, so add this to the start of the
+ * currently executing opcode, which hasn't run this
+ * interval.
+ */
+ profile->starttime += now - profile->gc_time;
+
+ /* prepare start for next step */
+ profile->gc_time = now;
+ }
+}
+
+
+/*
+
=back
=head1 SEE ALSO
More information about the parrot-commits
mailing list