[svn:parrot] r38849 - trunk/src/gc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Sat May 16 21:37:21 UTC 2009
Author: whiteknight
Date: Sat May 16 21:37:20 2009
New Revision: 38849
URL: https://trac.parrot.org/parrot/changeset/38849
Log:
[gc] a large series of cleanups, trying to rename things to be more consistent.
Modified:
trunk/src/gc/api.c
trunk/src/gc/gc_ms.c
trunk/src/gc/gc_private.h
trunk/src/gc/generational_ms.c
trunk/src/gc/incremental_ms.c
trunk/src/gc/mark_sweep.c
trunk/src/gc/pools.c
trunk/src/gc/res_lea.c
Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/api.c Sat May 16 21:37:20 2009 (r38849)
@@ -183,7 +183,7 @@
#endif
Parrot_initialize_memory_pools(interp);
- Parrot_initialize_header_pools(interp);
+ initialize_header_pools(interp);
}
/*
@@ -761,18 +761,18 @@
/* heavily borrowed from forall_header_pools */
fix_pmc_syncs(dest_interp, source_arena->constant_pmc_pool);
- Parrot_small_object_pool_merge(dest_interp, dest_arena->constant_pmc_pool,
+ Parrot_gc_merge_buffer_pools(dest_interp, dest_arena->constant_pmc_pool,
source_arena->constant_pmc_pool);
fix_pmc_syncs(dest_interp, source_arena->pmc_pool);
- Parrot_small_object_pool_merge(dest_interp, dest_arena->pmc_pool,
+ Parrot_gc_merge_buffer_pools(dest_interp, dest_arena->pmc_pool,
source_arena->pmc_pool);
- Parrot_small_object_pool_merge(dest_interp,
+ Parrot_gc_merge_buffer_pools(dest_interp,
dest_arena->constant_string_header_pool,
source_arena->constant_string_header_pool);
- Parrot_small_object_pool_merge(dest_interp,
+ Parrot_gc_merge_buffer_pools(dest_interp,
dest_arena->pmc_ext_pool, source_arena->pmc_ext_pool);
for (i = 0; i < source_arena->num_sized; ++i) {
@@ -787,7 +787,7 @@
PARROT_ASSERT(dest_arena->sized_header_pools[i]);
}
- Parrot_small_object_pool_merge(dest_interp,
+ Parrot_gc_merge_buffer_pools(dest_interp,
dest_arena->sized_header_pools[i],
source_arena->sized_header_pools[i]);
}
@@ -837,7 +837,7 @@
=item C<void Parrot_gc_destroy_header_pools(PARROT_INTERP)>
Performs a garbage collection sweep on all pools, then frees them. Calls
-C<Parrot_forall_header_pools> to loop over all the pools, passing
+C<header_pools_iterate_callback> to loop over all the pools, passing
C<sweep_cb_pmc> and C<sweep_cb_buf> callback routines. Frees the array of sized
header pointers in the C<Arenas> structure too.
@@ -862,12 +862,12 @@
const INTVAL start = 2;
#endif
- Parrot_forall_header_pools(interp, POOL_PMC, NULL, sweep_cb_pmc);
- Parrot_forall_header_pools(interp, POOL_PMC | POOL_CONST, NULL,
+ header_pools_iterate_callback(interp, POOL_PMC, NULL, sweep_cb_pmc);
+ header_pools_iterate_callback(interp, POOL_PMC | POOL_CONST, NULL,
sweep_cb_pmc);
for (pass = start; pass <= 2; pass++) {
- Parrot_forall_header_pools(interp, POOL_BUFFER | POOL_CONST,
+ header_pools_iterate_callback(interp, POOL_BUFFER | POOL_CONST,
(void *)pass, sweep_cb_buf);
}
Modified: trunk/src/gc/gc_ms.c
==============================================================================
--- trunk/src/gc/gc_ms.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/gc_ms.c Sat May 16 21:37:20 2009 (r38849)
@@ -71,11 +71,7 @@
__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,
+static int gc_ms_sweep_cb(PARROT_INTERP,
ARGMOD(Small_Object_Pool *pool),
int flag,
ARGMOD(void *arg))
@@ -85,6 +81,10 @@
FUNC_MODIFIES(*pool)
FUNC_MODIFIES(*arg);
+static int gc_ms_trace_active_PMCs(PARROT_INTERP,
+ Parrot_gc_trace_type trace)
+ __attribute__nonnull__(1);
+
#define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(to_add)
@@ -107,12 +107,12 @@
|| 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 = \
+#define ASSERT_ARGS_gc_ms_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(arg)
+#define ASSERT_ARGS_gc_ms_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: static */
@@ -232,8 +232,8 @@
pt_gc_stop_mark(interp);
/* Now put unused PMCs and Buffers on the free list */
- ignored = Parrot_forall_header_pools(interp, POOL_BUFFER | POOL_PMC,
- (void*)&total_free, sweep_cb);
+ ignored = header_pools_iterate_callback(interp, POOL_BUFFER | POOL_PMC,
+ (void*)&total_free, gc_ms_sweep_cb);
UNUSED(ignored);
if (interp->profile)
@@ -284,8 +284,8 @@
/*
-=item C<static int 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
@@ -296,10 +296,10 @@
*/
static int
-sweep_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag,
+gc_ms_sweep_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag,
ARGMOD(void *arg))
{
- ASSERT_ARGS(sweep_cb)
+ ASSERT_ARGS(gc_ms_sweep_cb)
int * const total_free = (int *) arg;
Parrot_gc_sweep_pool(interp, pool);
@@ -388,7 +388,8 @@
*/
static void
-gc_ms_add_free_object(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGIN(void *to_add))
+gc_ms_add_free_object(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool),
+ ARGIN(void *to_add))
{
ASSERT_ARGS(gc_ms_add_free_object)
PObj *object = (PObj *)to_add;
@@ -497,7 +498,7 @@
=over 4
-=item C<void gc_pmc_ext_pool_init(Small_Object_Pool *pool)>
+=item C<void gc_ms_pmc_ext_pool_init(Small_Object_Pool *pool)>
Initialize the PMC_EXT pool functions. This is done separately from other
pools.
@@ -507,9 +508,9 @@
*/
void
-gc_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
+gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
{
- ASSERT_ARGS(gc_pmc_ext_pool_init)
+ ASSERT_ARGS(gc_ms_pmc_ext_pool_init)
pool->add_free_object = gc_ms_add_free_pmc_ext;
pool->get_free_object = gc_ms_get_free_pmc_ext;
pool->alloc_objects = gc_ms_alloc_objects;
Modified: trunk/src/gc/gc_private.h
==============================================================================
--- trunk/src/gc/gc_private.h Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/gc_private.h Sat May 16 21:37:20 2009 (r38849)
@@ -360,10 +360,6 @@
int Parrot_gc_trace_root(PARROT_INTERP, Parrot_gc_trace_type trace)
__attribute__nonnull__(1);
-int Parrot_is_const_pmc(PARROT_INTERP, ARGIN(const PMC *pmc))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
#define ASSERT_ARGS_contained_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(ptr)
@@ -390,9 +386,6 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_trace_root __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_is_const_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(pmc)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/gc/mark_sweep.c */
@@ -430,56 +423,29 @@
size_t get_min_pmc_address(PARROT_INTERP)
__attribute__nonnull__(1);
-PARROT_WARN_UNUSED_RESULT
-int is_buffer_ptr(PARROT_INTERP, ARGIN(const void *ptr))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-int is_pmc_ptr(PARROT_INTERP, ARGIN(const void *ptr))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * new_buffer_pool(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP,
- size_t actual_buffer_size)
- __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * new_pmc_pool(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
- __attribute__nonnull__(1);
-
PARROT_IGNORABLE_RESULT
int /*@alt void@*/
-Parrot_forall_header_pools(PARROT_INTERP,
+header_pools_iterate_callback(PARROT_INTERP,
int flag,
ARGIN_NULLOK(void *arg),
NOTNULL(pool_iter_fn func))
__attribute__nonnull__(1)
__attribute__nonnull__(4);
-void Parrot_initialize_header_pools(PARROT_INTERP)
+void initialize_header_pools(PARROT_INTERP)
__attribute__nonnull__(1);
-void Parrot_merge_memory_pools(
- ARGIN(Interp *dest_interp),
- ARGIN(Interp *source_interp))
+PARROT_WARN_UNUSED_RESULT
+int is_buffer_ptr(PARROT_INTERP, ARGIN(const void *ptr))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-void Parrot_small_object_pool_merge(PARROT_INTERP,
+PARROT_WARN_UNUSED_RESULT
+int is_pmc_ptr(PARROT_INTERP, ARGIN(const void *ptr))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+void Parrot_gc_merge_buffer_pools(PARROT_INTERP,
ARGMOD(Small_Object_Pool *dest),
ARGMOD(Small_Object_Pool *source))
__attribute__nonnull__(1)
@@ -488,6 +454,12 @@
FUNC_MODIFIES(*dest)
FUNC_MODIFIES(*source);
+void Parrot_gc_merge_memory_pools(
+ ARGIN(Interp *dest_interp),
+ ARGIN(Interp *source_interp))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
#define ASSERT_ARGS_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_get_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -503,34 +475,24 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_get_min_pmc_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_header_pools_iterate_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(func)
+#define ASSERT_ARGS_initialize_header_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_is_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(ptr)
#define ASSERT_ARGS_is_pmc_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_new_buffer_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_string_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_forall_header_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(func)
-#define ASSERT_ARGS_Parrot_initialize_header_pools \
- __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_merge_memory_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(dest_interp) \
- || PARROT_ASSERT_ARG(source_interp)
-#define ASSERT_ARGS_Parrot_small_object_pool_merge \
- __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_gc_merge_buffer_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(dest) \
|| PARROT_ASSERT_ARG(source)
+#define ASSERT_ARGS_Parrot_gc_merge_memory_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(dest_interp) \
+ || PARROT_ASSERT_ARG(source_interp)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/gc/pools.c */
@@ -693,14 +655,14 @@
/* HEADERIZER BEGIN: src/gc/gc_ms.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-void gc_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
+void gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
__attribute__nonnull__(1)
FUNC_MODIFIES(*pool);
void Parrot_gc_ms_init(PARROT_INTERP)
__attribute__nonnull__(1);
-#define ASSERT_ARGS_gc_pmc_ext_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_gc_ms_pmc_ext_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_Parrot_gc_ms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
Modified: trunk/src/gc/generational_ms.c
==============================================================================
--- trunk/src/gc/generational_ms.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/generational_ms.c Sat May 16 21:37:20 2009 (r38849)
@@ -1269,7 +1269,7 @@
plan.merge_gen = 1;
else
gmsp->current_gen_no = 1;
- Parrot_forall_header_pools(interp, POOL_ALL, &plan, set_gen_cb);
+ header_pools_iterate_callback(interp, POOL_ALL, &plan, set_gen_cb);
}
/*
@@ -1543,7 +1543,7 @@
arena_base->num_early_PMCs_seen = 0;
arena_base->num_extended_PMCs = 0;
- Parrot_forall_header_pools(interp, POOL_ALL, 0, init_mark_cb);
+ header_pools_iterate_callback(interp, POOL_ALL, 0, init_mark_cb);
}
/*
@@ -1594,7 +1594,7 @@
if (ret == 0)
return 0;
- Parrot_forall_header_pools(interp, POOL_ALL, 0, trace_igp_cb);
+ header_pools_iterate_callback(interp, POOL_ALL, 0, trace_igp_cb);
return ret;
}
@@ -1661,7 +1661,7 @@
gc_gms_trace_children(PARROT_INTERP)
{
ASSERT_ARGS(gc_gms_trace_children)
- return !Parrot_forall_header_pools(interp, POOL_PMC, 0,
+ return !header_pools_iterate_callback(interp, POOL_PMC, 0,
trace_children_cb);
}
@@ -1789,8 +1789,8 @@
gc_gms_sweep(PARROT_INTERP)
{
ASSERT_ARGS(gc_gms_sweep)
- Parrot_forall_header_pools(interp, POOL_PMC, 0, sweep_cb_pmc);
- Parrot_forall_header_pools(interp, POOL_BUFFER, 0, sweep_cb_buf);
+ header_pools_iterate_callback(interp, POOL_PMC, 0, sweep_cb_pmc);
+ header_pools_iterate_callback(interp, POOL_BUFFER, 0, sweep_cb_buf);
}
/*
@@ -1835,7 +1835,7 @@
gc_gms_end_cycle(PARROT_INTERP)
{
ASSERT_ARGS(gc_gms_end_cycle)
- Parrot_forall_header_pools(interp, POOL_ALL, 0, end_cycle_cb);
+ header_pools_iterate_callback(interp, POOL_ALL, 0, end_cycle_cb);
}
/*
@@ -1875,7 +1875,7 @@
pool->white = pool->marker.next;
/* XXX need to sweep over objects that have finalizers only */
- Parrot_forall_header_pools(interp, POOL_PMC, 0, sweep_cb_pmc);
+ header_pools_iterate_callback(interp, POOL_PMC, 0, sweep_cb_pmc);
gc_gms_end_cycle(interp);
--arena_base->gc_mark_block_level;
return;
Modified: trunk/src/gc/incremental_ms.c
==============================================================================
--- trunk/src/gc/incremental_ms.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/incremental_ms.c Sat May 16 21:37:20 2009 (r38849)
@@ -759,7 +759,7 @@
=item C<static int sweep_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag,
void *arg)>
-Callback to sweep a header pool (see Parrot_forall_header_pools).
+Callback to sweep a header pool (see header_pools_iterate_callback).
=cut
@@ -820,7 +820,7 @@
/* now sweep all */
n_objects = 0;
- ignored = Parrot_forall_header_pools(interp, POOL_BUFFER | POOL_PMC,
+ ignored = header_pools_iterate_callback(interp, POOL_BUFFER | POOL_PMC,
(void*)&n_objects, sweep_cb);
UNUSED(ignored);
@@ -838,7 +838,7 @@
=item C<static int collect_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag,
void *arg)>
-Callback to collect a header pool (see Parrot_forall_header_pools).
+Callback to collect a header pool (see header_pools_iterate_callback).
=cut
@@ -911,7 +911,7 @@
g_ims = (Gc_ims_private *)arena_base->gc_private;
- ret = Parrot_forall_header_pools(interp, POOL_BUFFER,
+ ret = header_pools_iterate_callback(interp, POOL_BUFFER,
(void *)(long)check_only, collect_cb);
if (ret)
Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/mark_sweep.c Sat May 16 21:37:20 2009 (r38849)
@@ -314,33 +314,6 @@
return 0;
}
-/*
-
-=item C<int Parrot_is_const_pmc(PARROT_INTERP, const PMC *pmc)>
-
-Returns whether C<*pmc> is a constant PMC. The given pointer is a constant
-PMC if it points into the constant PMC pool.
-
-=cut
-
-*/
-
-int
-Parrot_is_const_pmc(PARROT_INTERP, ARGIN(const PMC *pmc))
-{
- ASSERT_ARGS(Parrot_is_const_pmc)
- Small_Object_Pool * const pool = interp->arena_base->constant_pmc_pool;
- const int c = contained_in_pool(pool, pmc);
-
- /* some paranoia first. */
- /* I wonder if it would save any machine cycles to write
- !(PObj_constant_TEST(pmc) ^ c)
- instead. */
- PARROT_ASSERT(!!PObj_constant_TEST(pmc) == !!c);
-
- return c;
-}
-
/*
@@ -592,6 +565,7 @@
=cut
*/
+
void
Parrot_append_arena_in_pool(PARROT_INTERP,
ARGMOD(Small_Object_Pool *pool),
Modified: trunk/src/gc/pools.c
==============================================================================
--- trunk/src/gc/pools.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/pools.c Sat May 16 21:37:20 2009 (r38849)
@@ -22,19 +22,40 @@
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-static void gc_pool_free_pmc(PARROT_INTERP,
+static void free_pmc_in_pool(PARROT_INTERP,
SHIM(Small_Object_Pool *pool),
ARGMOD(PObj *p))
__attribute__nonnull__(1)
__attribute__nonnull__(3)
FUNC_MODIFIES(*p);
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static Small_Object_Pool * new_buffer_pool(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP,
+ size_t actual_buffer_size)
+ __attribute__nonnull__(1);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static Small_Object_Pool * new_pmc_pool(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
static Small_Object_Pool * new_small_object_pool(
size_t object_size,
size_t objects_per_alloc);
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
+ __attribute__nonnull__(1);
+
static void Parrot_gc_free_buffer(SHIM_INTERP,
ARGMOD(Small_Object_Pool *pool),
ARGMOD(PObj *b))
@@ -49,10 +70,18 @@
__attribute__nonnull__(3)
FUNC_MODIFIES(*b);
-#define ASSERT_ARGS_gc_pool_free_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(p)
+#define ASSERT_ARGS_new_buffer_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_new_small_object_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_new_string_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(b)
@@ -81,7 +110,7 @@
=over 4
-=item C<void Parrot_merge_memory_pools(Interp *dest_interp, Interp
+=item C<void Parrot_gc_merge_memory_pools(Interp *dest_interp, Interp
*source_interp)>
Merge the memory pools of two interpreter structures. Merge the general
@@ -93,9 +122,9 @@
*/
void
-Parrot_merge_memory_pools(ARGIN(Interp *dest_interp), ARGIN(Interp *source_interp))
+Parrot_gc_merge_memory_pools(ARGIN(Interp *dest_interp), ARGIN(Interp *source_interp))
{
- ASSERT_ARGS(Parrot_merge_memory_pools)
+ ASSERT_ARGS(Parrot_gc_merge_memory_pools)
merge_pools(dest_interp->arena_base->constant_string_pool,
source_interp->arena_base->constant_string_pool);
@@ -105,7 +134,7 @@
/*
-=item C<void Parrot_small_object_pool_merge(PARROT_INTERP, Small_Object_Pool
+=item C<void Parrot_gc_merge_buffer_pools(PARROT_INTERP, Small_Object_Pool
*dest, Small_Object_Pool *source)>
Merge pool C<source> into pool C<dest>. Combines the free lists directly,
@@ -118,10 +147,10 @@
*/
void
-Parrot_small_object_pool_merge(PARROT_INTERP,
+Parrot_gc_merge_buffer_pools(PARROT_INTERP,
ARGMOD(Small_Object_Pool *dest), ARGMOD(Small_Object_Pool *source))
{
- ASSERT_ARGS(Parrot_small_object_pool_merge)
+ ASSERT_ARGS(Parrot_gc_merge_buffer_pools)
Small_Object_Arena *cur_arena;
void **free_list_end;
@@ -219,7 +248,7 @@
=over 4
-=item C<Small_Object_Pool * new_pmc_pool(PARROT_INTERP)>
+=item C<static Small_Object_Pool * new_pmc_pool(PARROT_INTERP)>
Creates and initializes a new pool for PMCs and returns it.
@@ -229,7 +258,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool *
+static Small_Object_Pool *
new_pmc_pool(PARROT_INTERP)
{
ASSERT_ARGS(new_pmc_pool)
@@ -238,7 +267,7 @@
new_small_object_pool(sizeof (PMC), num_headers);
pmc_pool->mem_pool = NULL;
- pmc_pool->gc_object = gc_pool_free_pmc;
+ pmc_pool->gc_object = free_pmc_in_pool;
(interp->arena_base->init_pool)(interp, pmc_pool);
return pmc_pool;
@@ -246,7 +275,7 @@
/*
-=item C<static void gc_pool_free_pmc(PARROT_INTERP, Small_Object_Pool *pool,
+=item C<static void free_pmc_in_pool(PARROT_INTERP, Small_Object_Pool *pool,
PObj *p)>
Frees a PMC that is no longer being used. Calls a custom C<destroy> VTABLE
@@ -258,10 +287,10 @@
*/
static void
-gc_pool_free_pmc(PARROT_INTERP, SHIM(Small_Object_Pool *pool),
+free_pmc_in_pool(PARROT_INTERP, SHIM(Small_Object_Pool *pool),
ARGMOD(PObj *p))
{
- ASSERT_ARGS(gc_pool_free_pmc)
+ ASSERT_ARGS(free_pmc_in_pool)
PMC * const pmc = (PMC *)p;
Arenas * const arena_base = interp->arena_base;
@@ -285,10 +314,9 @@
}
-
/*
-=item C<Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP, size_t
+=item C<static Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP, size_t
actual_buffer_size)>
Creates a new pool for buffer-like structures. This is called from
@@ -300,7 +328,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool *
+static Small_Object_Pool *
new_bufferlike_pool(PARROT_INTERP, size_t actual_buffer_size)
{
ASSERT_ARGS(new_bufferlike_pool)
@@ -351,7 +379,7 @@
/*
-=item C<Small_Object_Pool * new_buffer_pool(PARROT_INTERP)>
+=item C<static Small_Object_Pool * new_buffer_pool(PARROT_INTERP)>
Creates a new C<Small_Object_Pool> structure for managing buffer objects.
@@ -363,7 +391,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool *
+static Small_Object_Pool *
new_buffer_pool(PARROT_INTERP)
{
ASSERT_ARGS(new_buffer_pool)
@@ -447,7 +475,8 @@
/*
-=item C<Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)>
+=item C<static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL
+constant)>
Creates a new pool for C<STRING>s and returns it. This calls
C<get_bufferlike_pool> internally, which in turn calls C<new_bufferlike_pool>.
@@ -458,7 +487,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool *
+static Small_Object_Pool *
new_string_pool(PARROT_INTERP, INTVAL constant)
{
ASSERT_ARGS(new_string_pool)
@@ -682,7 +711,7 @@
/*
-=item C<void Parrot_initialize_header_pools(PARROT_INTERP)>
+=item C<void initialize_header_pools(PARROT_INTERP)>
The initialization routine for the interpreter's header pools. Initializes
pools for string headers, constant string headers, buffers, PMCs, PMC_EXTs, and
@@ -696,9 +725,9 @@
*/
void
-Parrot_initialize_header_pools(PARROT_INTERP)
+initialize_header_pools(PARROT_INTERP)
{
- ASSERT_ARGS(Parrot_initialize_header_pools)
+ ASSERT_ARGS(initialize_header_pools)
Arenas * const arena_base = interp->arena_base;
/* Init the constant string header pool */
@@ -732,7 +761,7 @@
* marked.
* Use GS MS pool functions
*/
- gc_pmc_ext_pool_init(arena_base->pmc_ext_pool);
+ gc_ms_pmc_ext_pool_init(arena_base->pmc_ext_pool);
#else
/* rational, consistant behavior (as yet unwritten) */
#endif
@@ -743,13 +772,13 @@
arena_base->constant_pmc_pool = new_pmc_pool(interp);
arena_base->constant_pmc_pool->name = "constant_pmc";
arena_base->constant_pmc_pool->objects_per_alloc =
- CONSTANT_PMC_HEADERS_PER_ALLOC;
+ CONSTANT_PMC_HEADERS_PER_ALLOC;
}
/*
-=item C<int Parrot_forall_header_pools(PARROT_INTERP, int flag, void *arg,
+=item C<int header_pools_iterate_callback(PARROT_INTERP, int flag, void *arg,
pool_iter_fn func)>
Iterates through header pools, invoking the given callback function on each
@@ -789,10 +818,10 @@
PARROT_IGNORABLE_RESULT
int
-Parrot_forall_header_pools(PARROT_INTERP, int flag, ARGIN_NULLOK(void *arg),
+header_pools_iterate_callback(PARROT_INTERP, int flag, ARGIN_NULLOK(void *arg),
NOTNULL(pool_iter_fn func))
{
- ASSERT_ARGS(Parrot_forall_header_pools)
+ ASSERT_ARGS(header_pools_iterate_callback)
Arenas * const arena_base = interp->arena_base;
if (flag & POOL_PMC) {
Modified: trunk/src/gc/res_lea.c
==============================================================================
--- trunk/src/gc/res_lea.c Sat May 16 21:36:59 2009 (r38848)
+++ trunk/src/gc/res_lea.c Sat May 16 21:37:20 2009 (r38849)
@@ -254,7 +254,7 @@
/*
-=item C<void Parrot_merge_memory_pools(Interp *dest, Interp *source)>
+=item C<void Parrot_gc_merge_memory_pools(Interp *dest, Interp *source)>
Does nothing.
@@ -262,7 +262,7 @@
*/
void
-Parrot_merge_memory_pools(Interp *dest, Interp *source)
+Parrot_gc_merge_memory_pools(Interp *dest, Interp *source)
{
ASSERT_ARGS(parrot_merge_memory_pools)
}
More information about the parrot-commits
mailing list