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

darbelo at svn.parrot.org darbelo at svn.parrot.org
Wed Sep 16 19:50:05 UTC 2009


Author: darbelo
Date: Wed Sep 16 19:50:04 2009
New Revision: 41307
URL: https://trac.parrot.org/parrot/changeset/41307

Log:
[cage] Headerize gc files after the gc-refactor merge.

Modified:
   trunk/src/gc/alloc_resources.c
   trunk/src/gc/api.c
   trunk/src/gc/gc_inf.c
   trunk/src/gc/gc_ms.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	Wed Sep 16 19:13:51 2009	(r41306)
+++ trunk/src/gc/alloc_resources.c	Wed Sep 16 19:50:04 2009	(r41307)
@@ -54,16 +54,16 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void check_var_size_obj_pool(ARGMOD(Variable_Size_Pool *pool))
+static void check_fixed_size_obj_pool(ARGMOD(Fixed_Size_Pool * pool))
         __attribute__nonnull__(1)
-        FUNC_MODIFIES(*pool);
+        FUNC_MODIFIES(* pool);
 
 static void check_memory_system(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-static void check_fixed_size_obj_pool(ARGMOD(Fixed_Size_Pool * pool))
+static void check_var_size_obj_pool(ARGMOD(Variable_Size_Pool *pool))
         __attribute__nonnull__(1)
-        FUNC_MODIFIES(* pool);
+        FUNC_MODIFIES(*pool);
 
 static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
         __attribute__nonnull__(1)
@@ -82,11 +82,11 @@
 #define ASSERT_ARGS_buffer_location __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_check_var_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_check_fixed_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(pool)
 #define ASSERT_ARGS_check_memory_system __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_check_fixed_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_check_var_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(pool)
 #define ASSERT_ARGS_debug_print_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
@@ -98,8 +98,8 @@
 
 /*
 
-=item C<static void alloc_new_block(PARROT_INTERP, size_t size, Variable_Size_Pool
-*pool, const char *why)>
+=item C<static void alloc_new_block(PARROT_INTERP, 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
@@ -158,7 +158,8 @@
 
 /*
 
-=item C<void * mem_allocate(PARROT_INTERP, size_t size, Variable_Size_Pool *pool)>
+=item C<void * mem_allocate(PARROT_INTERP, size_t size, Variable_Size_Pool
+*pool)>
 
 Allocates memory for headers.
 

Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c	Wed Sep 16 19:13:51 2009	(r41306)
+++ trunk/src/gc/api.c	Wed Sep 16 19:50:04 2009	(r41307)
@@ -871,8 +871,8 @@
 
 /*
 
-=item C<static void Parrot_gc_merge_buffer_pools(PARROT_INTERP,
-Fixed_Size_Pool *dest, Fixed_Size_Pool *source)>
+=item C<static void Parrot_gc_merge_buffer_pools(PARROT_INTERP, Fixed_Size_Pool
+*dest, Fixed_Size_Pool *source)>
 
 Merge pool C<source> into pool C<dest>. Combines the free lists directly,
 moves all arenas to the new pool, and remove the old pool. To merge, the
@@ -1045,8 +1045,8 @@
 
 /*
 
-=item C<static int sweep_cb_pmc(PARROT_INTERP, Fixed_Size_Pool *pool, int
-flag, void *arg)>
+=item C<static int sweep_cb_pmc(PARROT_INTERP, Fixed_Size_Pool *pool, int flag,
+void *arg)>
 
 Performs a garbage collection sweep of the given pmc pool, then frees it. Calls
 C<Parrot_gc_sweep_pool> to perform the sweep, and C<free_pool> to free the pool and
@@ -1067,8 +1067,8 @@
 
 /*
 
-=item C<static int sweep_cb_buf(PARROT_INTERP, Fixed_Size_Pool *pool, int
-flag, void *arg)>
+=item C<static int sweep_cb_buf(PARROT_INTERP, Fixed_Size_Pool *pool, int flag,
+void *arg)>
 
 Performs a final garbage collection sweep, then frees the pool. Calls
 C<Parrot_gc_sweep_pool> to perform the sweep, and C<free_pool> to free the pool and

Modified: trunk/src/gc/gc_inf.c
==============================================================================
--- trunk/src/gc/gc_inf.c	Wed Sep 16 19:13:51 2009	(r41306)
+++ trunk/src/gc/gc_inf.c	Wed Sep 16 19:50:04 2009	(r41307)
@@ -44,8 +44,7 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pool);
 
-static void gc_inf_alloc_objects(SHIM_INTERP,
-    ARGMOD(Fixed_Size_Pool *pool))
+static void gc_inf_alloc_objects(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
@@ -112,8 +111,8 @@
 
 /*
 
-=item C<static void gc_inf_add_free_object(PARROT_INTERP, Fixed_Size_Pool
-*pool, void *to_add)>
+=item C<static void gc_inf_add_free_object(PARROT_INTERP, Fixed_Size_Pool *pool,
+void *to_add)>
 
 Manually frees a chunk of memory. Normally this would return the memory
 to the free list of the pool, but in this case we just return it to the
@@ -169,8 +168,7 @@
 
 /*
 
-=item C<static void gc_inf_alloc_objects(PARROT_INTERP, Fixed_Size_Pool
-*pool)>
+=item C<static void gc_inf_alloc_objects(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 Allocates a new arena of objects from the system. This function is only
 really used internally by the core, the API functions don't need to call
@@ -192,8 +190,8 @@
 
 /*
 
-=item C<static void gc_inf_more_traceable_objects(PARROT_INTERP,
-Fixed_Size_Pool *pool)>
+=item C<static void gc_inf_more_traceable_objects(PARROT_INTERP, Fixed_Size_Pool
+*pool)>
 
 Would normally try to find new traceable objects by first running a GC sweep
 and then allocating a new arena from the system. Neither of these are

Modified: trunk/src/gc/gc_ms.c
==============================================================================
--- trunk/src/gc/gc_ms.c	Wed Sep 16 19:13:51 2009	(r41306)
+++ trunk/src/gc/gc_ms.c	Wed Sep 16 19:50:04 2009	(r41307)
@@ -35,7 +35,8 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-static void gc_ms_finalize(PARROT_INTERP, ARGIN(Memory_Pools * const mem_pools))
+static void gc_ms_finalize(PARROT_INTERP,
+    ARGIN(Memory_Pools * const mem_pools))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -202,7 +203,8 @@
 
 /*
 
-=item C<static void gc_ms_finalize(PARROT_INTERP, Memory_Pools * const mem_pools)>
+=item C<static void gc_ms_finalize(PARROT_INTERP, Memory_Pools * const
+mem_pools)>
 
 Perform the finalization run, freeing all PMCs.
 
@@ -313,8 +315,8 @@
 
 /*
 
-=item C<static void gc_ms_more_traceable_objects(PARROT_INTERP,
-Fixed_Size_Pool *pool)>
+=item C<static void gc_ms_more_traceable_objects(PARROT_INTERP, Fixed_Size_Pool
+*pool)>
 
 We're out of traceable objects. First we try a GC run to free some up. If
 that doesn't work, allocate a new arena.
@@ -351,8 +353,8 @@
 
 /*
 
-=item C<static void gc_ms_add_free_object(PARROT_INTERP, Fixed_Size_Pool
-*pool, void *to_add)>
+=item C<static void gc_ms_add_free_object(PARROT_INTERP, Fixed_Size_Pool *pool,
+void *to_add)>
 
 Add an unused object back to the pool's free list for later reuse. Set
 the PObj flags to indicate that the item is free.

Modified: trunk/src/gc/gc_private.h
==============================================================================
--- trunk/src/gc/gc_private.h	Wed Sep 16 19:13:51 2009	(r41306)
+++ trunk/src/gc/gc_private.h	Wed Sep 16 19:50:04 2009	(r41307)
@@ -541,7 +541,9 @@
 PARROT_WARN_UNUSED_RESULT
 size_t aligned_string_size(size_t len);
 
-void check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Variable_Size_Pool * pool))
+void check_buffer_ptr(
+    ARGMOD(Buffer * pobj),
+    ARGMOD(Variable_Size_Pool * pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(* pobj)
@@ -557,12 +559,16 @@
 
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-void * mem_allocate(PARROT_INTERP, size_t size, ARGMOD(Variable_Size_Pool *pool))
+void * mem_allocate(PARROT_INTERP,
+    size_t size,
+    ARGMOD(Variable_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pool);
 
-void merge_pools(ARGMOD(Variable_Size_Pool *dest), ARGMOD(Variable_Size_Pool *source))
+void merge_pools(
+    ARGMOD(Variable_Size_Pool *dest),
+    ARGMOD(Variable_Size_Pool *source))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*dest)

Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c	Wed Sep 16 19:13:51 2009	(r41306)
+++ trunk/src/gc/mark_sweep.c	Wed Sep 16 19:50:04 2009	(r41307)
@@ -58,11 +58,6 @@
     size_t actual_buffer_size)
         __attribute__nonnull__(1);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Fixed_Size_Pool * new_pmc_pool(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
 static Fixed_Size_Pool * new_fixed_size_obj_pool(
@@ -71,6 +66,11 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
+static Fixed_Size_Pool * new_pmc_pool(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static Fixed_Size_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
         __attribute__nonnull__(1);
 
@@ -95,9 +95,9 @@
     || PARROT_ASSERT_ARG(p)
 #define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_fixed_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
 #define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_fixed_size_obj_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_allocate_new_attributes_arena \
@@ -688,8 +688,8 @@
 
 /*
 
-=item C<static void free_pmc_in_pool(PARROT_INTERP, Fixed_Size_Pool *pool,
-PObj *p)>
+=item C<static void free_pmc_in_pool(PARROT_INTERP, Fixed_Size_Pool *pool, PObj
+*p)>
 
 Frees a PMC that is no longer being used. Calls a custom C<destroy> VTABLE
 method if one is available.


More information about the parrot-commits mailing list