[svn:parrot] r38570 - in branches/gc_api: include/parrot src/gc

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Fri May 8 01:10:27 UTC 2009


Author: whiteknight
Date: Fri May  8 01:10:27 2009
New Revision: 38570
URL: https://trac.parrot.org/parrot/changeset/38570

Log:
[gc_api] Parrot_gc_free_buffer is not an API function. Parrot_gc_profile_start is not either. Move these elsewhere

Modified:
   branches/gc_api/include/parrot/gc_api.h
   branches/gc_api/include/parrot/resources.h
   branches/gc_api/src/gc/api.c
   branches/gc_api/src/gc/pools.c
   branches/gc_api/src/gc/resources.c

Modified: branches/gc_api/include/parrot/gc_api.h
==============================================================================
--- branches/gc_api/include/parrot/gc_api.h	Fri May  8 00:59:22 2009	(r38569)
+++ branches/gc_api/include/parrot/gc_api.h	Fri May  8 01:10:27 2009	(r38570)
@@ -68,14 +68,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
-void Parrot_gc_free_buffer(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGMOD(PObj *b))
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pool)
-        FUNC_MODIFIES(*b);
-
 void Parrot_gc_free_bufferlike_header(PARROT_INTERP,
     ARGMOD(PObj *obj),
     size_t size)
@@ -109,9 +101,6 @@
 void Parrot_gc_profile_end(PARROT_INTERP, int what)
         __attribute__nonnull__(1);
 
-void Parrot_gc_profile_start(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 #define ASSERT_ARGS_Parrot_do_gc_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_gc_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -120,9 +109,6 @@
 #define ASSERT_ARGS_Parrot_gc_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_gc_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(b)
 #define ASSERT_ARGS_Parrot_gc_free_bufferlike_header \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
@@ -141,8 +127,6 @@
        PARROT_ASSERT_ARG(interp)
 #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)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/gc/api.c */
 

Modified: branches/gc_api/include/parrot/resources.h
==============================================================================
--- branches/gc_api/include/parrot/resources.h	Fri May  8 00:59:22 2009	(r38569)
+++ branches/gc_api/include/parrot/resources.h	Fri May  8 01:10:27 2009	(r38570)
@@ -59,6 +59,9 @@
 void Parrot_destroy_memory_pools(PARROT_INTERP)
         __attribute__nonnull__(1);
 
+void Parrot_gc_profile_start(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 void Parrot_go_collect(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -101,6 +104,8 @@
     || PARROT_ASSERT_ARG(str)
 #define ASSERT_ARGS_Parrot_destroy_memory_pools __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_go_collect __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_in_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: branches/gc_api/src/gc/api.c
==============================================================================
--- branches/gc_api/src/gc/api.c	Fri May  8 00:59:22 2009	(r38569)
+++ branches/gc_api/src/gc/api.c	Fri May  8 01:10:27 2009	(r38570)
@@ -296,55 +296,6 @@
     p->pmc_ext = NULL;
 }
 
-
-/*
-
-=item C<void Parrot_gc_free_buffer(PARROT_INTERP, Small_Object_Pool *pool, PObj
-*b)>
-
-Frees a buffer, returning it to the memory pool for Parrot to possibly
-reuse later.
-
-=cut
-
-*/
-
-void
-Parrot_gc_free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(PObj *b))
-{
-    ASSERT_ARGS(Parrot_gc_free_buffer)
-    Memory_Pool * const mem_pool = (Memory_Pool *)pool->mem_pool;
-
-    /* XXX Jarkko reported that on irix pool->mem_pool was NULL, which really
-     * shouldn't happen */
-    if (mem_pool) {
-        if (!PObj_COW_TEST(b))
-            mem_pool->guaranteed_reclaimable += PObj_buflen(b);
-
-         mem_pool->possibly_reclaimable += PObj_buflen(b);
-    }
-
-    PObj_buflen(b)        = 0;
-}
-
-/*
-
-=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)>

Modified: branches/gc_api/src/gc/pools.c
==============================================================================
--- branches/gc_api/src/gc/pools.c	Fri May  8 00:59:22 2009	(r38569)
+++ branches/gc_api/src/gc/pools.c	Fri May  8 01:10:27 2009	(r38570)
@@ -33,6 +33,14 @@
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*pool);
 
+static void Parrot_gc_free_buffer(SHIM_INTERP,
+    ARGMOD(Small_Object_Pool *pool),
+    ARGMOD(PObj *b))
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*pool)
+        FUNC_MODIFIES(*b);
+
 static void Parrot_gc_free_buffer_malloc(SHIM_INTERP,
     SHIM(Small_Object_Pool *pool),
     ARGMOD(PObj *b))
@@ -61,6 +69,9 @@
     || PARROT_ASSERT_ARG(pool)
 #define ASSERT_ARGS_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_Parrot_gc_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(b)
 #define ASSERT_ARGS_Parrot_gc_free_buffer_malloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(b)
 #define ASSERT_ARGS_sweep_cb_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -253,6 +264,35 @@
         mem_sys_free(PObj_bufrefcountptr(b));
 }
 
+/*
+
+=item C<static void Parrot_gc_free_buffer(PARROT_INTERP, Small_Object_Pool
+*pool, PObj *b)>
+
+Frees a buffer, returning it to the memory pool for Parrot to possibly
+reuse later.
+
+=cut
+
+*/
+
+static void
+Parrot_gc_free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(PObj *b))
+{
+    ASSERT_ARGS(Parrot_gc_free_buffer)
+    Memory_Pool * const mem_pool = (Memory_Pool *)pool->mem_pool;
+
+    /* XXX Jarkko reported that on irix pool->mem_pool was NULL, which really
+     * shouldn't happen */
+    if (mem_pool) {
+        if (!PObj_COW_TEST(b))
+            mem_pool->guaranteed_reclaimable += PObj_buflen(b);
+
+         mem_pool->possibly_reclaimable += PObj_buflen(b);
+    }
+
+    PObj_buflen(b)        = 0;
+}
 
 
 /*

Modified: branches/gc_api/src/gc/resources.c
==============================================================================
--- branches/gc_api/src/gc/resources.c	Fri May  8 00:59:22 2009	(r38569)
+++ branches/gc_api/src/gc/resources.c	Fri May  8 01:10:27 2009	(r38570)
@@ -1132,6 +1132,24 @@
 
 /*
 
+=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();
+}
+
+/*
+
 =back
 
 =head1 SEE ALSO


More information about the parrot-commits mailing list