develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35436 - trunk/src/gc

From:
cotto
Date:
January 12, 2009 05:03
Subject:
[svn:parrot] r35436 - trunk/src/gc
Message ID:
20090112130324.E1A45CB9F9@x12.develooper.com
Author: cotto
Date: Mon Jan 12 05:03:24 2009
New Revision: 35436

Modified:
   trunk/src/gc/generational_ms.c

Log:
[gc] add some ASSERT_ARGS macros


Modified: trunk/src/gc/generational_ms.c
==============================================================================
--- trunk/src/gc/generational_ms.c	(original)
+++ trunk/src/gc/generational_ms.c	Mon Jan 12 05:03:24 2009
@@ -509,6 +509,7 @@
 static void
 parrot_gc_gms_deinit(PARROT_INTERP)
 {
+    ASSERT_ARGS(parrot_gc_gms_deinit)
     Arenas * const arena_base = interp->arena_base;
 
     /*
@@ -533,6 +534,7 @@
 static void
 gc_gms_pool_init(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
 {
+    ASSERT_ARGS(gc_gms_pool_init)
     pool->add_free_object = gc_gms_add_free_object;
     pool->get_free_object = gc_gms_get_free_object;
     pool->alloc_objects   = gc_gms_alloc_objects;
@@ -593,6 +595,7 @@
 gc_gms_add_free_object(PARROT_INTERP, SHIM(Small_Object_Pool *pool),
         SHIM(PObj *to_add))
 {
+    ASSERT_ARGS(gc_gms_add_free_object)
     Parrot_ex_throw_from_c_args(interp, NULL, 1, "gms abuse");
 }
 
@@ -642,6 +645,7 @@
 gc_gms_chain_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
         ARGIN(Small_Object_Arena *new_arena), size_t real_size)
 {
+    ASSERT_ARGS(gc_gms_chain_objects)
     Gc_gms_hdr *next, *prev;
     size_t i, n;
 
@@ -699,6 +703,7 @@
 static void
 gc_gms_alloc_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
 {
+    ASSERT_ARGS(gc_gms_alloc_objects)
     const size_t real_size = pool->object_size;
     Small_Object_Arena * const new_arena = mem_internal_allocate(sizeof (Small_Object_Arena));
     const size_t size = real_size * pool->objects_per_alloc;
@@ -731,6 +736,7 @@
 static void
 gc_gms_more_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
 {
+    ASSERT_ARGS(gc_gms_more_objects)
     if (pool->skip)
         pool->skip = 0;
     else if (pool->last_Arena) {
@@ -762,6 +768,7 @@
 static PObj *
 gc_gms_get_free_object(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
 {
+    ASSERT_ARGS(gc_gms_get_free_object)
     PObj *ptr;
     Gc_gms_hdr *hdr;
 
@@ -814,6 +821,7 @@
 static Gc_gms_gen *
 gc_gms_create_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), size_t gen_no)
 {
+    ASSERT_ARGS(gc_gms_create_gen)
     Gc_gms_gen * const gen = mem_sys_allocate(sizeof (*gen));
 
     gen->gen_no = gen_no;
@@ -842,6 +850,7 @@
 static void
 gc_gms_init_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
 {
+    ASSERT_ARGS(gc_gms_init_gen)
     Gc_gms_private *gmsp;
     /*
      * Generations are numbered beginning at zero
@@ -873,6 +882,7 @@
 static Gc_gms_gen *
 gc_gms_find_gen(PARROT_INTERP, ARGIN(const Gc_gms_hdr *h), UINTVAL gen_no)
 {
+    ASSERT_ARGS(gc_gms_find_gen)
     Gc_gms_gen *gen;
     const Small_Object_Pool * const pool = h->gen->pool;
 
@@ -908,6 +918,7 @@
 static void
 gc_gms_promote(PARROT_INTERP, ARGIN(Gc_gms_hdr *h), UINTVAL gen_no)
 {
+    ASSERT_ARGS(gc_gms_promote)
     Gc_gms_gen *gen;
     Gc_gms_hdr *prev, *next;
     Small_Object_Pool * const pool = h->gen->pool;
@@ -955,6 +966,7 @@
 static void
 gc_gms_store_hdr_list(PARROT_INTERP, ARGMOD(Gc_gms_hdr_list *l), ARGIN(Gc_gms_hdr *h))
 {
+    ASSERT_ARGS(gc_gms_store_hdr_list)
     Gc_gms_hdr_store * const s = l->last;
 
     /* if it's not created or if it's full allocate new store */
@@ -988,6 +1000,7 @@
 static void
 gc_gms_clear_hdr_list(PARROT_INTERP, ARGMOD(Gc_gms_hdr_list *l))
 {
+    ASSERT_ARGS(gc_gms_clear_hdr_list)
     Gc_gms_hdr_store *s, *next;
 
     for (s = l->first; s; s = next) {
@@ -1010,6 +1023,7 @@
 static void
 gc_gms_store_igp(PARROT_INTERP, ARGIN(Gc_gms_hdr *h))
 {
+    ASSERT_ARGS(gc_gms_store_igp)
     Gc_gms_gen * const gen = h->gen;
     Gc_gms_hdr_list * const igp = &gen->igp;
 
@@ -1029,6 +1043,7 @@
 static void
 gc_gms_clear_igp(PARROT_INTERP, ARGIN(Gc_gms_gen *gen))
 {
+    ASSERT_ARGS(gc_gms_clear_igp)
     Gc_gms_hdr_list * const igp = &gen->igp;
 
     gc_gms_clear_hdr_list(interp, igp);
@@ -1119,6 +1134,7 @@
 gc_gms_merge_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
         int flag, SHIM(Gc_gms_plan *plan))
 {
+    ASSERT_ARGS(gc_gms_merge_gen)
     Gc_gms_hdr *h;
 
     /* run through the blacks and set their generation pointer
@@ -1153,6 +1169,7 @@
 gc_gms_use_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
         int flag, ARGIN(const Gc_gms_plan *plan))
 {
+    ASSERT_ARGS(gc_gms_use_gen)
     Gc_gms_gen *gen, *prev;
     UINTVAL next_gen;
 
@@ -1188,6 +1205,7 @@
 static int
 set_gen_cb(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, ARGIN(void *arg))
 {
+    ASSERT_ARGS(set_gen_cb)
     Gc_gms_plan * const plan = (Gc_gms_plan *)arg;
 
     if (plan->merge_gen)
@@ -1210,6 +1228,7 @@
 static void
 gc_gms_set_gen(PARROT_INTERP)
 {
+    ASSERT_ARGS(gc_gms_set_gen)
     Gc_gms_plan plan;
     Gc_gms_private *gmsp;
     /*
@@ -1326,6 +1345,7 @@
 static void
 gc_gms_setto_gray(PARROT_INTERP, ARGIN(Gc_gms_hdr *h), int priority)
 {
+    ASSERT_ARGS(gc_gms_setto_gray)
     Small_Object_Pool * const pool = h->gen->pool;
     /*
      * TODO high_priority like in src/gc/api.c
@@ -1388,6 +1408,7 @@
 static void
 gc_gms_setto_black(PARROT_INTERP, ARGMOD(Gc_gms_hdr *h), int priority)
 {
+    ASSERT_ARGS(gc_gms_setto_black)
     Small_Object_Pool * const pool = h->gen->pool;
 
     /*
@@ -1476,6 +1497,7 @@
 static int
 init_mark_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, ARGIN(void *arg))
 {
+    ASSERT_ARGS(init_mark_cb)
     pool->gray = pool->black = pool->black_fin = pool->white;
 #  if GC_GMS_DEBUG
     gms_debug_verify(interp, pool, "init_mark");
@@ -1496,6 +1518,7 @@
 static void
 gc_gms_init_mark(PARROT_INTERP)
 {
+    ASSERT_ARGS(gc_gms_init_mark)
     Arenas * const arena_base = interp->arena_base;
 
     arena_base->dod_trace_ptr = NULL;
@@ -1519,6 +1542,7 @@
 static int
 trace_igp_cb(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, SHIM(void *arg))
 {
+    ASSERT_ARGS(trace_igp_cb)
     Gc_gms_hdr_store *s;
     Gc_gms_gen * const gen = pool->last_gen;
     Gc_gms_hdr_list * const igp = &gen->igp;
@@ -1546,6 +1570,7 @@
 static int
 gc_gms_trace_root(PARROT_INTERP, int trace_stack)
 {
+    ASSERT_ARGS(gc_gms_trace_root)
     const int ret = Parrot_gc_trace_root(interp, trace_stack);
 
     if (ret == 0)
@@ -1567,6 +1592,7 @@
 static int
 trace_children_cb(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, SHIM(void *arg))
 {
+    ASSERT_ARGS(trace_children_cb)
     Arenas * const arena_base = interp->arena_base;
     const int lazy_dod = arena_base->lazy_dod;
     const UINTVAL mask = PObj_data_is_PMC_array_FLAG | PObj_custom_mark_FLAG;
@@ -1631,6 +1657,7 @@
 static int
 gc_gms_trace_children(PARROT_INTERP)
 {
+    ASSERT_ARGS(gc_gms_trace_children)
     return !Parrot_forall_header_pools(interp, POOL_PMC, 0,
             trace_children_cb);
 }
@@ -1650,6 +1677,7 @@
 static int
 sweep_cb_pmc(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, SHIM(void *arg))
 {
+    ASSERT_ARGS(sweep_cb_pmc)
     Gc_gms_hdr *h;
     Arenas * const arena_base = interp->arena_base;
 
@@ -1687,6 +1715,7 @@
 static int
 sweep_cb_buf(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, SHIM(void *arg))
 {
+    ASSERT_ARGS(sweep_cb_buf)
     Gc_gms_hdr *h;
 
     /* TODO object stats */
@@ -1754,6 +1783,7 @@
 static void
 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);
 }
@@ -1771,6 +1801,7 @@
 static int
 end_cycle_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, SHIM(void *arg))
 {
+    ASSERT_ARGS(end_cycle_cb)
     Gc_gms_hdr *h;
     /*
      * clear live flags
@@ -1797,6 +1828,7 @@
 static void
 gc_gms_end_cycle(PARROT_INTERP)
 {
+    ASSERT_ARGS(gc_gms_end_cycle)
     Parrot_forall_header_pools(interp, POOL_ALL, 0, end_cycle_cb);
 }
 
@@ -1823,6 +1855,7 @@
 static void
 parrot_gc_gms_run(PARROT_INTERP, UINTVAL flags)
 {
+    ASSERT_ARGS(parrot_gc_gms_run)
     Arenas * const arena_base = interp->arena_base;
     Gc_gms_private *g_gms;
 
@@ -1875,6 +1908,7 @@
 static void
 gms_debug_verify(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), ARGIN(const char *action))
 {
+    ASSERT_ARGS(gms_debug_verify)
     Gc_gms_hdr *h;
     int bf, gf, wf, ff;
     size_t i;



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About