[svn:parrot] r38850 - trunk/src/gc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Sat May 16 21:50:30 UTC 2009
Author: whiteknight
Date: Sat May 16 21:50:29 2009
New Revision: 38850
URL: https://trac.parrot.org/parrot/changeset/38850
Log:
[gc] a few more small function moves.
Modified:
trunk/src/gc/api.c
trunk/src/gc/gc_ms.c
trunk/src/gc/gc_private.h
trunk/src/gc/mark_sweep.c
trunk/src/gc/res_lea.c
trunk/src/gc/resources.c
Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c Sat May 16 21:37:20 2009 (r38849)
+++ trunk/src/gc/api.c Sat May 16 21:50:29 2009 (r38850)
@@ -182,7 +182,7 @@
Parrot_gc_gms_init(interp);
#endif
- Parrot_initialize_memory_pools(interp);
+ initialize_memory_pools(interp);
initialize_header_pools(interp);
}
Modified: trunk/src/gc/gc_ms.c
==============================================================================
--- trunk/src/gc/gc_ms.c Sat May 16 21:37:20 2009 (r38849)
+++ trunk/src/gc/gc_ms.c Sat May 16 21:50:29 2009 (r38850)
@@ -284,8 +284,8 @@
/*
-=item C<static int gc_ms_sweep_cb(PARROT_INTERP, Small_Object_Pool *pool,
-int flag, void *arg)>
+=item C<static int gc_ms_sweep_cb(PARROT_INTERP, Small_Object_Pool *pool, int
+flag, void *arg)>
Sweeps the given pool for the MS collector. This function also ends
the profiling timer, if profiling is enabled. Returns the total number
Modified: trunk/src/gc/gc_private.h
==============================================================================
--- trunk/src/gc/gc_private.h Sat May 16 21:37:20 2009 (r38849)
+++ trunk/src/gc/gc_private.h Sat May 16 21:50:29 2009 (r38850)
@@ -346,6 +346,12 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
+void Parrot_gc_profile_end(PARROT_INTERP, int what)
+ __attribute__nonnull__(1);
+
+void Parrot_gc_profile_start(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
void Parrot_gc_run_init(PARROT_INTERP)
__attribute__nonnull__(1);
@@ -377,6 +383,10 @@
#define ASSERT_ARGS_Parrot_gc_clear_live_bits __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
+#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_gc_run_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_sweep_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -519,6 +529,9 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*pool);
+void initialize_memory_pools(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
void * mem_allocate(PARROT_INTERP, size_t size, ARGMOD(Memory_Pool *pool))
@@ -532,20 +545,6 @@
FUNC_MODIFIES(*dest)
FUNC_MODIFIES(*source);
-void Parrot_allocate(PARROT_INTERP, ARGOUT(Buffer *buffer), size_t size)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*buffer);
-
-void Parrot_gc_profile_end(PARROT_INTERP, int what)
- __attribute__nonnull__(1);
-
-void Parrot_gc_profile_start(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-void Parrot_initialize_memory_pools(PARROT_INTERP)
- __attribute__nonnull__(1);
-
#define ASSERT_ARGS_aligned_mem __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(buffer) \
|| PARROT_ASSERT_ARG(mem)
@@ -555,22 +554,14 @@
#define ASSERT_ARGS_compact_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_initialize_memory_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_mem_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_merge_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(dest) \
|| PARROT_ASSERT_ARG(source)
-#define ASSERT_ARGS_Parrot_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(buffer)
-#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_initialize_memory_pools \
- __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/resources.c */
Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c Sat May 16 21:37:20 2009 (r38849)
+++ trunk/src/gc/mark_sweep.c Sat May 16 21:50:29 2009 (r38850)
@@ -594,6 +594,59 @@
interp->arena_base->header_allocs_since_last_collect++;
}
+/*
+
+=item C<void Parrot_gc_profile_start(PARROT_INTERP)>
+
+Records the start time of a GC mark run when profiling is enabled.
+
+=cut
+
+*/
+
+void
+Parrot_gc_profile_start(PARROT_INTERP)
+{
+ ASSERT_ARGS(Parrot_gc_profile_start)
+ if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG))
+ interp->profile->gc_time = Parrot_floatval_time();
+}
+
+/*
+
+=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;
+ }
+}
+
/*
Modified: trunk/src/gc/res_lea.c
==============================================================================
--- trunk/src/gc/res_lea.c Sat May 16 21:37:20 2009 (r38849)
+++ trunk/src/gc/res_lea.c Sat May 16 21:50:29 2009 (r38850)
@@ -155,7 +155,8 @@
/*
-=item C<void Parrot_allocate(PARROT_INTERP, Buffer *buffer, size_t size)>
+=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP,
+Buffer *buffer, size_t size)>
Allocate buffer memory for the given Buffer pointer. The C<size>
has to be a multiple of the word size.
@@ -238,7 +239,7 @@
/*
-=item C<void Parrot_initialize_memory_pools(PARROT_INTERP)>
+=item C<void initialize_memory_pools(PARROT_INTERP)>
Does nothing.
@@ -247,7 +248,7 @@
*/
void
-Parrot_initialize_memory_pools(PARROT_INTERP)
+initialize_memory_pools(PARROT_INTERP)
{
ASSERT_ARGS(parrot_initialize_memory_pools)
}
Modified: trunk/src/gc/resources.c
==============================================================================
--- trunk/src/gc/resources.c Sat May 16 21:37:20 2009 (r38849)
+++ trunk/src/gc/resources.c Sat May 16 21:50:29 2009 (r38850)
@@ -623,31 +623,6 @@
=over 4
-
-=item C<void Parrot_allocate(PARROT_INTERP, Buffer *buffer, size_t size)>
-
-Allocate buffer memory for the given Buffer pointer. The C<size>
-has to be a multiple of the word size.
-C<PObj_buflen> will be set to exactly the given C<size>.
-
-=cut
-
-*/
-
-void
-Parrot_allocate(PARROT_INTERP, ARGOUT(Buffer *buffer), size_t size)
-{
- ASSERT_ARGS(Parrot_allocate)
- PObj_buflen(buffer) = 0;
- PObj_bufstart(buffer) = NULL;
- PARROT_ASSERT((size & WORD_ALIGN_1) == 0);
- PObj_bufstart(buffer) = mem_allocate(interp, size,
- interp->arena_base->memory_pool);
- PObj_buflen(buffer) = size;
-}
-
-/*
-
=item C<static Memory_Pool * new_memory_pool(size_t min_block, compact_f
compact)>
@@ -679,7 +654,7 @@
/*
-=item C<void Parrot_initialize_memory_pools(PARROT_INTERP)>
+=item C<void initialize_memory_pools(PARROT_INTERP)>
Initialize the managed memory pools. Parrot maintains two C<Memory_Pool>
structures, the general memory pool and the constant string pool. Create
@@ -691,9 +666,9 @@
*/
void
-Parrot_initialize_memory_pools(PARROT_INTERP)
+initialize_memory_pools(PARROT_INTERP)
{
- ASSERT_ARGS(Parrot_initialize_memory_pools)
+ ASSERT_ARGS(initialize_memory_pools)
Arenas * const arena_base = interp->arena_base;
arena_base->memory_pool = new_memory_pool(POOL_SIZE, &compact_pool);
@@ -753,60 +728,6 @@
/*
-=item C<void Parrot_gc_profile_start(PARROT_INTERP)>
-
-Records the start time of a GC mark run when profiling is enabled.
-
-=cut
-
-*/
-
-void
-Parrot_gc_profile_start(PARROT_INTERP)
-{
- ASSERT_ARGS(Parrot_gc_profile_start)
- if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG))
- interp->profile->gc_time = Parrot_floatval_time();
-}
-
-/*
-
-=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