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

petdance at svn.parrot.org petdance at svn.parrot.org
Sat Apr 3 05:02:30 UTC 2010


Author: petdance
Date: Sat Apr  3 05:02:30 2010
New Revision: 45391
URL: https://trac.parrot.org/parrot/changeset/45391

Log:
removing unused args from static funcs

Modified:
   trunk/src/gc/alloc_resources.c
   trunk/src/gc/gc_private.h
   trunk/src/gc/mark_sweep.c

Modified: trunk/src/gc/alloc_resources.c
==============================================================================
--- trunk/src/gc/alloc_resources.c	Sat Apr  3 05:01:19 2010	(r45390)
+++ trunk/src/gc/alloc_resources.c	Sat Apr  3 05:02:30 2010	(r45391)
@@ -39,15 +39,14 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static void alloc_new_block(PARROT_INTERP,
-    ARGMOD(Memory_Pools *mem_pools),
+static void alloc_new_block(
+     ARGMOD(Memory_Pools *mem_pools),
     size_t size,
     ARGMOD(Variable_Size_Pool *pool),
     ARGIN(const char *why))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
         __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
         FUNC_MODIFIES(*mem_pools)
         FUNC_MODIFIES(*pool);
 
@@ -80,15 +79,14 @@
         FUNC_MODIFIES(*dest_interp);
 
 static void free_memory_pool(ARGFREE(Variable_Size_Pool *pool));
-static void free_old_mem_blocks(PARROT_INTERP,
-    ARGMOD(Memory_Pools *mem_pools),
+static void free_old_mem_blocks(
+     ARGMOD(Memory_Pools *mem_pools),
     ARGMOD(Variable_Size_Pool *pool),
     ARGMOD(Memory_Block *new_block),
     UINTVAL total_size)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
         FUNC_MODIFIES(*mem_pools)
         FUNC_MODIFIES(*pool)
         FUNC_MODIFIES(*new_block);
@@ -113,9 +111,8 @@
     ARGIN_NULLOK(compact_f compact));
 
 PARROT_CANNOT_RETURN_NULL
-static UINTVAL pad_pool_size(PARROT_INTERP, ARGIN(Variable_Size_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+static UINTVAL pad_pool_size(ARGIN(const Variable_Size_Pool *pool))
+        __attribute__nonnull__(1);
 
 static void Parrot_gc_merge_buffer_pools(PARROT_INTERP,
     ARGMOD(Memory_Pools *mem_pools),
@@ -149,8 +146,7 @@
         FUNC_MODIFIES(*pool);
 
 #define ASSERT_ARGS_alloc_new_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(mem_pools) \
+       PARROT_ASSERT_ARG(mem_pools) \
     , PARROT_ASSERT_ARG(pool) \
     , PARROT_ASSERT_ARG(why))
 #define ASSERT_ARGS_buffer_location __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -171,8 +167,7 @@
     , PARROT_ASSERT_ARG(pool))
 #define ASSERT_ARGS_free_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_free_old_mem_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(mem_pools) \
+       PARROT_ASSERT_ARG(mem_pools) \
     , PARROT_ASSERT_ARG(pool) \
     , PARROT_ASSERT_ARG(new_block))
 #define ASSERT_ARGS_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
@@ -182,8 +177,7 @@
     , PARROT_ASSERT_ARG(new_pool_ptr))
 #define ASSERT_ARGS_new_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_pad_pool_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(pool))
+       PARROT_ASSERT_ARG(pool))
 #define ASSERT_ARGS_Parrot_gc_merge_buffer_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(mem_pools) \
@@ -202,8 +196,8 @@
 
 /*
 
-=item C<static void alloc_new_block(PARROT_INTERP, Memory_Pools *mem_pools,
-size_t size, Variable_Size_Pool *pool, const char *why)>
+=item C<static void alloc_new_block( Memory_Pools *mem_pools, size_t size,
+Variable_Size_Pool *pool, const char *why)>
 
 Allocate a new memory block. We allocate either the requested size or the
 default size, whichever is larger. Add the new block to the given memory
@@ -214,7 +208,7 @@
 */
 
 static void
-alloc_new_block(PARROT_INTERP,
+alloc_new_block(
         ARGMOD(Memory_Pools *mem_pools),
         size_t size,
         ARGMOD(Variable_Size_Pool *pool),
@@ -348,7 +342,7 @@
              * Mark the block as big block (it has just one item)
              * And don't set big blocks as the top_block.
              */
-            alloc_new_block(interp, mem_pools, size, pool, "compact failed");
+            alloc_new_block(mem_pools, size, pool, "compact failed");
 
             mem_pools->mem_allocs_since_last_collect++;
 
@@ -465,8 +459,8 @@
     mem_pools->gc_collect_runs++;
 
     /* Snag a block big enough for everything */
-    total_size = pad_pool_size(interp, pool);
-    alloc_new_block(interp, mem_pools, total_size, pool, "inside compact");
+    total_size = pad_pool_size(pool);
+    alloc_new_block(mem_pools, total_size, pool, "inside compact");
 
     new_block = pool->top_block;
 
@@ -508,14 +502,14 @@
     new_block->free = new_block->size - (cur_spot - new_block->start);
     mem_pools->memory_collected +=      (cur_spot - new_block->start);
 
-    free_old_mem_blocks(interp, mem_pools, pool, new_block, total_size);
+    free_old_mem_blocks(mem_pools, pool, new_block, total_size);
 
     --mem_pools->gc_sweep_block_level;
 }
 
 /*
 
-=item C<static UINTVAL pad_pool_size(PARROT_INTERP, Variable_Size_Pool *pool)>
+=item C<static UINTVAL pad_pool_size(const Variable_Size_Pool *pool)>
 
 Calculate the size of the new pool. The currently used size equals the total
 size minus the reclaimable size. Add a minimum block to the current amount, so
@@ -542,11 +536,10 @@
 
 PARROT_CANNOT_RETURN_NULL
 static UINTVAL
-pad_pool_size(PARROT_INTERP,
-        ARGIN(Variable_Size_Pool *pool))
+pad_pool_size(ARGIN(const Variable_Size_Pool *pool))
 {
     ASSERT_ARGS(pad_pool_size)
-    Memory_Block *cur_block = pool->top_block;
+    const Memory_Block *cur_block = pool->top_block;
 
     UINTVAL total_size = 0;
 
@@ -677,7 +670,7 @@
 
 /*
 
-=item C<static void free_old_mem_blocks(PARROT_INTERP, Memory_Pools *mem_pools,
+=item C<static void free_old_mem_blocks( Memory_Pools *mem_pools,
 Variable_Size_Pool *pool, Memory_Block *new_block, UINTVAL total_size)>
 
 The compact_pool operation collects disjointed blocks of memory allocated on a
@@ -693,7 +686,7 @@
 */
 
 static void
-free_old_mem_blocks(PARROT_INTERP,
+free_old_mem_blocks(
         ARGMOD(Memory_Pools *mem_pools),
         ARGMOD(Variable_Size_Pool *pool),
         ARGMOD(Memory_Block *new_block),
@@ -743,7 +736,7 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 char *
-aligned_mem(ARGIN(const Buffer *buffer), ARGIN(char *mem))
+aligned_mem(SHIM(const Buffer *buffer), ARGIN(char *mem))
 {
     ASSERT_ARGS(aligned_mem)
 #if 0
@@ -839,16 +832,16 @@
 */
 
 void
-initialize_var_size_pools(PARROT_INTERP, ARGMOD(Memory_Pools *mem_pools))
+initialize_var_size_pools(SHIM_INTERP, ARGMOD(Memory_Pools *mem_pools))
 {
     ASSERT_ARGS(initialize_var_size_pools)
 
     mem_pools->memory_pool   = new_memory_pool(POOL_SIZE, &compact_pool);
-    alloc_new_block(interp, mem_pools, POOL_SIZE, mem_pools->memory_pool, "init");
+    alloc_new_block(mem_pools, POOL_SIZE, mem_pools->memory_pool, "init");
 
     /* Constant strings - not compacted */
     mem_pools->constant_string_pool = new_memory_pool(POOL_SIZE, NULL);
-    alloc_new_block(interp, mem_pools, POOL_SIZE, mem_pools->constant_string_pool, "init");
+    alloc_new_block(mem_pools, POOL_SIZE, mem_pools->constant_string_pool, "init");
 }
 
 
@@ -1282,8 +1275,7 @@
 */
 
 void
-Parrot_gc_destroy_memory_pools(PARROT_INTERP,
-        ARGMOD(Memory_Pools *mem_pools))
+Parrot_gc_destroy_memory_pools(SHIM_INTERP, ARGMOD(Memory_Pools *mem_pools))
 {
     ASSERT_ARGS(Parrot_gc_destroy_memory_pools)
 

Modified: trunk/src/gc/gc_private.h
==============================================================================
--- trunk/src/gc/gc_private.h	Sat Apr  3 05:01:19 2010	(r45390)
+++ trunk/src/gc/gc_private.h	Sat Apr  3 05:02:30 2010	(r45391)
@@ -486,8 +486,7 @@
 
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-char * aligned_mem(ARGIN(const Buffer *buffer), ARGIN(char *mem))
-        __attribute__nonnull__(1)
+char * aligned_mem(SHIM(const Buffer *buffer), ARGIN(char *mem))
         __attribute__nonnull__(2);
 
 PARROT_CONST_FUNCTION
@@ -511,9 +510,7 @@
         FUNC_MODIFIES(*mem_pools)
         FUNC_MODIFIES(*pool);
 
-void initialize_var_size_pools(PARROT_INTERP,
-    ARGMOD(Memory_Pools *mem_pools))
-        __attribute__nonnull__(1)
+void initialize_var_size_pools(SHIM_INTERP, ARGMOD(Memory_Pools *mem_pools))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*mem_pools);
 
@@ -543,9 +540,8 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*mem_pools);
 
-void Parrot_gc_destroy_memory_pools(PARROT_INTERP,
+void Parrot_gc_destroy_memory_pools(SHIM_INTERP,
     ARGMOD(Memory_Pools *mem_pools))
-        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*mem_pools);
 
@@ -560,8 +556,7 @@
         FUNC_MODIFIES(*dest_arena);
 
 #define ASSERT_ARGS_aligned_mem __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(buffer) \
-    , PARROT_ASSERT_ARG(mem))
+       PARROT_ASSERT_ARG(mem))
 #define ASSERT_ARGS_aligned_string_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_check_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(pobj) \
@@ -571,8 +566,7 @@
     , PARROT_ASSERT_ARG(mem_pools) \
     , PARROT_ASSERT_ARG(pool))
 #define ASSERT_ARGS_initialize_var_size_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(mem_pools))
+       PARROT_ASSERT_ARG(mem_pools))
 #define ASSERT_ARGS_mem_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(mem_pools) \
@@ -586,8 +580,7 @@
     , PARROT_ASSERT_ARG(mem_pools))
 #define ASSERT_ARGS_Parrot_gc_destroy_memory_pools \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(mem_pools))
+       PARROT_ASSERT_ARG(mem_pools))
 #define ASSERT_ARGS_Parrot_gc_merge_memory_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest_interp) \
     , PARROT_ASSERT_ARG(dest_arena) \

Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c	Sat Apr  3 05:01:19 2010	(r45390)
+++ trunk/src/gc/mark_sweep.c	Sat Apr  3 05:02:30 2010	(r45391)
@@ -862,7 +862,7 @@
     ASSERT_ARGS(header_pools_iterate_callback)
 
     if (flag & POOL_PMC) {
-        Fixed_Size_Pool *pool = flag & POOL_CONST
+        Fixed_Size_Pool * const pool = flag & POOL_CONST
             ? mem_pools->constant_pmc_pool
             : mem_pools->pmc_pool;
 


More information about the parrot-commits mailing list