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

[svn:parrot] r35364 - in branches/pdd09gc_part2: include/parrot src src/charset src/gc

From:
chromatic
Date:
January 10, 2009 14:40
Subject:
[svn:parrot] r35364 - in branches/pdd09gc_part2: include/parrot src src/charset src/gc
Message ID:
20090110224047.01768CB9F9@x12.develooper.com
Author: chromatic
Date: Sat Jan 10 14:40:45 2009
New Revision: 35364

Modified:
   branches/pdd09gc_part2/include/parrot/gc_api.h
   branches/pdd09gc_part2/include/parrot/gc_mark_sweep.h
   branches/pdd09gc_part2/include/parrot/headers.h
   branches/pdd09gc_part2/src/charset/binary.c
   branches/pdd09gc_part2/src/gc/api.c
   branches/pdd09gc_part2/src/gc/generational_ms.c
   branches/pdd09gc_part2/src/gc/incremental_ms.c
   branches/pdd09gc_part2/src/gc/mark_sweep.c
   branches/pdd09gc_part2/src/headers.c

Log:
[GC] Moved several GC public functions from src/headers.c into src/gc/api.c.
Re-ran headerizer.


Modified: branches/pdd09gc_part2/include/parrot/gc_api.h
==============================================================================
--- branches/pdd09gc_part2/include/parrot/gc_api.h	(original)
+++ branches/pdd09gc_part2/include/parrot/gc_api.h	Sat Jan 10 14:40:45 2009
@@ -54,6 +54,36 @@
 /* HEADERIZER BEGIN: src/gc/api.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
+void add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pmc);
+
+void add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pmc);
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+Buffer * new_buffer_header(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+void * new_bufferlike_header(PARROT_INTERP, size_t size)
+        __attribute__nonnull__(1);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * new_pmc_header(PARROT_INTERP, UINTVAL flags)
+        __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+STRING * new_string_header(PARROT_INTERP, UINTVAL flags)
+        __attribute__nonnull__(1);
+
 void Parrot_do_dod_run(PARROT_INTERP, UINTVAL flags)
         __attribute__nonnull__(1);
 
@@ -101,6 +131,43 @@
 void trace_mem_block(PARROT_INTERP, size_t lo_var_ptr, size_t hi_var_ptr)
         __attribute__nonnull__(1);
 
+#define ASSERT_ARGS_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pmc)
+#define ASSERT_ARGS_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pmc)
+#define ASSERT_ARGS_new_buffer_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_bufferlike_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_do_dod_run __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)
+#define ASSERT_ARGS_Parrot_gc_free_buffer_malloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(b)
+#define ASSERT_ARGS_Parrot_gc_free_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(p)
+#define ASSERT_ARGS_Parrot_gc_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(p)
+#define ASSERT_ARGS_Parrot_gc_free_sysmem __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(b)
+#define ASSERT_ARGS_Parrot_gc_ms_run_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       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)
+#define ASSERT_ARGS_trace_mem_block __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 */
 
@@ -159,12 +226,32 @@
         __attribute__nonnull__(5)
         __attribute__nonnull__(6);
 
+#define ASSERT_ARGS_Parrot_gc_gms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_gms_pobject_lives __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(obj)
+#define ASSERT_ARGS_parrot_gc_gms_wb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(agg) \
+    || PARROT_ASSERT_ARG(old) \
+    || PARROT_ASSERT_ARG(_new)
+#define ASSERT_ARGS_parrot_gc_gms_wb_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(agg) \
+    || PARROT_ASSERT_ARG(old) \
+    || PARROT_ASSERT_ARG(old_key) \
+    || PARROT_ASSERT_ARG(_new) \
+    || PARROT_ASSERT_ARG(new_key)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/generational_gms.c */
+/* HEADERIZER END: src/gc/generational_ms.c */
 
 /* HEADERIZER BEGIN: src/gc/incremental_ms.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
+void Parrot_gc_ims_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 void Parrot_gc_ims_wb(PARROT_INTERP, ARGMOD(PMC *agg), ARGMOD(PMC *_new))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -172,15 +259,16 @@
         FUNC_MODIFIES(*agg)
         FUNC_MODIFIES(*_new);
 
-void Parrot_gc_ims_init(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
+#define ASSERT_ARGS_Parrot_gc_ims_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_ims_wb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(agg) \
+    || PARROT_ASSERT_ARG(_new)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/gc/incremental_ms.c */
 
-/*
- * write barrier
- */
+/* write barrier */
 #if PARROT_GC_IMS
 #  define GC_WRITE_BARRIER(interp, agg, old, _new) \
     do { \
@@ -188,7 +276,7 @@
                 PObj_live_TEST(agg) && \
                 (PObj_get_FLAGS(agg) & PObj_custom_GC_FLAG) && \
                 !PObj_live_TEST(_new)) { \
-            Parrot_gc_ims_wb((interp), (agg), (_new)); \
+            Parrot_dod_ims_wb((interp), (agg), (_new)); \
         } \
     } while (0)
 
@@ -225,13 +313,6 @@
 
 #endif
 
-/* HEADERIZER BEGIN: src/gc/gc_malloc.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/gc_malloc.c */
-
 #endif /* PARROT_GC_API_H_GUARD */
 
 /*

Modified: branches/pdd09gc_part2/include/parrot/gc_mark_sweep.h
==============================================================================
--- branches/pdd09gc_part2/include/parrot/gc_mark_sweep.h	(original)
+++ branches/pdd09gc_part2/include/parrot/gc_mark_sweep.h	Sat Jan 10 14:40:45 2009
@@ -222,6 +222,47 @@
         FUNC_MODIFIES(*dest)
         FUNC_MODIFIES(*source);
 
+#define ASSERT_ARGS_pobject_lives __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(obj)
+#define ASSERT_ARGS_contained_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(ptr)
+#define ASSERT_ARGS_gc_pmc_ext_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_new_small_object_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_Parrot_add_to_free_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(arena)
+#define ASSERT_ARGS_Parrot_append_arena_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(new_arena)
+#define ASSERT_ARGS_Parrot_gc_clear_live_bits __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_ms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_ms_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_Parrot_gc_trace_children __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_trace_pmc_data __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(p)
+#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)
+#define ASSERT_ARGS_Parrot_small_object_pool_merge \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(dest) \
+    || PARROT_ASSERT_ARG(source)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/gc/mark_sweep.c */
 

Modified: branches/pdd09gc_part2/include/parrot/headers.h
==============================================================================
--- branches/pdd09gc_part2/include/parrot/headers.h	(original)
+++ branches/pdd09gc_part2/include/parrot/headers.h	Sat Jan 10 14:40:45 2009
@@ -48,15 +48,16 @@
 /* HEADERIZER BEGIN: src/headers.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-void add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+Small_Object_Pool * get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
+        __attribute__nonnull__(1);
 
-void add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+void * get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
+        __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 size_t get_max_buffer_address(PARROT_INTERP)
@@ -86,24 +87,9 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
-        __attribute__nonnull__(1);
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Buffer * new_buffer_header(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
 Small_Object_Pool * new_buffer_pool(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-void * new_bufferlike_header(PARROT_INTERP, size_t size)
-        __attribute__nonnull__(1);
-
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP,
@@ -112,19 +98,9 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-PMC * new_pmc_header(PARROT_INTERP, UINTVAL flags)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
 Small_Object_Pool * new_pmc_pool(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-STRING * new_string_header(PARROT_INTERP, UINTVAL flags)
-        __attribute__nonnull__(1);
-
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
@@ -141,9 +117,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(4);
 
-void Parrot_initialize_header_pool_names(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 void Parrot_initialize_header_pools(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -154,14 +127,11 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*dest_interp);
 
-#define ASSERT_ARGS_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
 #define ASSERT_ARGS_get_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_get_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
 #define ASSERT_ARGS_get_max_buffer_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_get_max_pmc_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -176,22 +146,12 @@
 #define ASSERT_ARGS_is_pmc_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_get_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_buffer_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_new_buffer_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_bufferlike_header __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_header __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_header __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_destroy_header_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -199,9 +159,6 @@
 #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_pool_names \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_initialize_header_pools \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)

Modified: branches/pdd09gc_part2/src/charset/binary.c
==============================================================================
--- branches/pdd09gc_part2/src/charset/binary.c	(original)
+++ branches/pdd09gc_part2/src/charset/binary.c	Sat Jan 10 14:40:45 2009
@@ -28,8 +28,10 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 static INTVAL compare(SHIM_INTERP,
-    SHIM(const STRING *lhs),
-    SHIM(const STRING *rhs));
+    ARGIN(const STRING *lhs),
+    ARGIN(const STRING *rhs))
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_CANNOT_RETURN_NULL
 static STRING* compose(PARROT_INTERP, SHIM(STRING *source_string))
@@ -106,7 +108,9 @@
         __attribute__nonnull__(1);
 
 static UINTVAL validate(SHIM_INTERP, SHIM(STRING *source_string));
-#define ASSERT_ARGS_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(lhs) \
+    || PARROT_ASSERT_ARG(rhs)
 #define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = 0

Modified: branches/pdd09gc_part2/src/gc/api.c
==============================================================================
--- branches/pdd09gc_part2/src/gc/api.c	(original)
+++ branches/pdd09gc_part2/src/gc/api.c	Sat Jan 10 14:40:45 2009
@@ -39,6 +39,15 @@
 static size_t find_common_mask(PARROT_INTERP, size_t val1, size_t val2)
         __attribute__nonnull__(1);
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static PMC_EXT * new_pmc_ext(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_find_common_mask __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_pmc_ext __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 */
 
@@ -49,6 +58,216 @@
 
 #endif
 
+/*
+
+=item C<PMC * new_pmc_header>
+
+Gets a new PMC header from the PMC pool's free list. Guaranteed to return a
+valid PMC object or else Parrot will panic. Sets the necessary flags for the
+objects and initializes the PMC data pointer to C<NULL>.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC *
+new_pmc_header(PARROT_INTERP, UINTVAL flags)
+{
+    ASSERT_ARGS(new_pmc_header)
+    Small_Object_Pool * const pool = flags & PObj_constant_FLAG
+            ? interp->arena_base->constant_pmc_pool
+            : interp->arena_base->pmc_pool;
+    PMC * const pmc = (PMC *)pool->get_free_object(interp, pool);
+
+    if (!pmc)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
+            "Parrot VM: PMC allocation failed!\n");
+
+    /* clear flags, set is_PMC_FLAG */
+    if (flags & PObj_is_PMC_EXT_FLAG) {
+        flags |= PObj_is_special_PMC_FLAG;
+        pmc->pmc_ext = new_pmc_ext(interp);
+
+        if (flags & PObj_is_PMC_shared_FLAG)
+            add_pmc_sync(interp, pmc);
+    }
+    else
+        pmc->pmc_ext = NULL;
+
+    PObj_get_FLAGS(pmc) = PObj_is_PMC_FLAG|flags;
+    pmc->vtable         = NULL;
+
+#if ! PMC_DATA_IN_EXT
+    PMC_data(pmc)       = NULL;
+#endif
+
+    return pmc;
+}
+
+
+/*
+
+=item C<static PMC_EXT * new_pmc_ext>
+
+Gets a new free C<PMC_EXT> structure from the PMC_EXT pool. A pointer to the
+new PMC_EXT is returned. Does not check to ensure the PMC_EXT is non-null
+before it is returned (yet).
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static PMC_EXT *
+new_pmc_ext(PARROT_INTERP)
+{
+    ASSERT_ARGS(new_pmc_ext)
+    Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
+    /* XXX: Should we check here to ensure the PMC_EXT is non-null
+            like we do in C<new_pmc>? */
+    return (PMC_EXT *)pool->get_free_object(interp, pool);
+}
+
+
+/*
+
+=item C<void add_pmc_ext>
+
+Obtains a new C<PMC_EXT> structure, and attaches it to the given C<PMC>.
+Sets the necessary flags associated with the PMC_EXT structure. Ensures
+that the PMC_EXT structure is marked as "alive" by the GC.
+
+=cut
+
+*/
+
+void
+add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
+{
+    ASSERT_ARGS(add_pmc_ext)
+    pmc->pmc_ext = new_pmc_ext(interp);
+    PObj_is_PMC_EXT_SET(pmc);
+
+#ifdef PARROT_GC_IMS
+    /*
+     * preserve DDD color: a simple PMC  live = black
+     *                     an aggregate  live = grey
+     * set'em black
+     */
+    if (PObj_live_TEST(pmc))
+        PObj_get_FLAGS(pmc) |= PObj_custom_GC_FLAG;
+#endif
+
+    PMC_next_for_GC(pmc) = PMCNULL;
+}
+
+
+/*
+
+=item C<void add_pmc_sync>
+
+Adds a C<Sync*> structure to the given C<PMC>. Initializes the PMC's owner
+field and the synchronization mutext. Does not check to ensure the C<Sync *> is
+non-null.
+
+=cut
+
+*/
+
+void
+add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
+{
+    ASSERT_ARGS(add_pmc_sync)
+    if (!PObj_is_PMC_EXT_TEST(pmc))
+        add_pmc_ext(interp, pmc);
+
+    /* XXX: Should we test the Sync * for non-null? should we allocate these
+            from a bufferlike pool instead of directly from the system? */
+    PMC_sync(pmc)        = mem_allocate_typed(Sync);
+    PMC_sync(pmc)->owner = interp;
+
+    MUTEX_INIT(PMC_sync(pmc)->pmc_lock);
+}
+
+
+/*
+
+=item C<STRING * new_string_header>
+
+Returns a new C<STRING> header from the string pool or the constant string
+pool. Sets default flags on the string object: C<PObj_is_string_FLAG>,
+C<PObj_is_COWable_FLAG>, and C<PObj_live_FLAG> (for GC). Initializes the data
+field of the string buffer to C<NULL>.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+STRING *
+new_string_header(PARROT_INTERP, UINTVAL flags)
+{
+    ASSERT_ARGS(new_string_header)
+    STRING * const string = (STRING *)get_free_buffer(interp,
+        (flags & PObj_constant_FLAG)
+            ? interp->arena_base->constant_string_header_pool
+            : interp->arena_base->string_header_pool);
+
+    string->strstart        = NULL;
+    PObj_get_FLAGS(string) |=
+        flags | PObj_is_string_FLAG | PObj_is_COWable_FLAG | PObj_live_FLAG;
+
+    return string;
+}
+
+
+/*
+
+=item C<Buffer * new_buffer_header>
+
+Creates and returns a new C<Buffer> from the buffer header pool.  Calls
+C<get_free_buffer> to do all the work.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+Buffer *
+new_buffer_header(PARROT_INTERP)
+{
+    ASSERT_ARGS(new_buffer_header)
+    return (Buffer *)get_free_buffer(interp,
+            interp->arena_base->buffer_header_pool);
+}
+
+
+/*
+
+=item C<void * new_bufferlike_header>
+
+Returns a new buffer-like header from the appropriate sized pool.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+void *
+new_bufferlike_header(PARROT_INTERP, size_t size)
+{
+    ASSERT_ARGS(new_bufferlike_header)
+    Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
+
+    return get_free_buffer(interp, pool);
+}
+
 
 /*
 

Modified: branches/pdd09gc_part2/src/gc/generational_ms.c
==============================================================================
--- branches/pdd09gc_part2/src/gc/generational_ms.c	(original)
+++ branches/pdd09gc_part2/src/gc/generational_ms.c	Sat Jan 10 14:40:45 2009
@@ -330,6 +330,105 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+#define ASSERT_ARGS_end_cycle_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_chain_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(new_arena)
+#define ASSERT_ARGS_gc_gms_clear_hdr_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(l)
+#define ASSERT_ARGS_gc_gms_clear_igp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(gen)
+#define ASSERT_ARGS_gc_gms_create_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_end_cycle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_find_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(h)
+#define ASSERT_ARGS_gc_gms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_init_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_init_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_merge_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_more_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_gms_promote __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(h)
+#define ASSERT_ARGS_gc_gms_set_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_setto_black __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(h)
+#define ASSERT_ARGS_gc_gms_setto_gray __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(h)
+#define ASSERT_ARGS_gc_gms_store_hdr_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(l) \
+    || PARROT_ASSERT_ARG(h)
+#define ASSERT_ARGS_gc_gms_store_igp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(h)
+#define ASSERT_ARGS_gc_gms_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_trace_children __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_trace_root __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_gc_gms_use_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(plan)
+#define ASSERT_ARGS_gms_debug_verify __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(action)
+#define ASSERT_ARGS_init_mark_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(arg)
+#define ASSERT_ARGS_parrot_gc_gms_deinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_gms_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_set_gen_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(arg)
+#define ASSERT_ARGS_sweep_cb_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_sweep_cb_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_trace_children_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_trace_igp_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/pdd09gc_part2/src/gc/incremental_ms.c
==============================================================================
--- branches/pdd09gc_part2/src/gc/incremental_ms.c	(original)
+++ branches/pdd09gc_part2/src/gc/incremental_ms.c	Sat Jan 10 14:40:45 2009
@@ -408,6 +408,40 @@
         __attribute__nonnull__(4)
         FUNC_MODIFIES(*pool);
 
+#define ASSERT_ARGS_collect_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(arg)
+#define ASSERT_ARGS_gc_ims_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(to_add)
+#define ASSERT_ARGS_gc_ims_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ims_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ims_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_parrot_gc_ims_collect __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_ims_deinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_ims_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_ims_reinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_ims_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_ims_run_increment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_parrot_gc_ims_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(arg)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/pdd09gc_part2/src/gc/mark_sweep.c
==============================================================================
--- branches/pdd09gc_part2/src/gc/mark_sweep.c	(original)
+++ branches/pdd09gc_part2/src/gc/mark_sweep.c	Sat Jan 10 14:40:45 2009
@@ -93,6 +93,37 @@
 static int trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace)
         __attribute__nonnull__(1);
 
+#define ASSERT_ARGS_clear_live_bits __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(to_add)
+#define ASSERT_ARGS_gc_ms_add_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(to_add)
+#define ASSERT_ARGS_gc_ms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ms_get_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_gc_ms_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_mark_special __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(obj)
+#define ASSERT_ARGS_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pool) \
+    || PARROT_ASSERT_ARG(arg)
+#define ASSERT_ARGS_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 */
 

Modified: branches/pdd09gc_part2/src/headers.c
==============================================================================
--- branches/pdd09gc_part2/src/headers.c	(original)
+++ branches/pdd09gc_part2/src/headers.c	Sat Jan 10 14:40:45 2009
@@ -33,17 +33,6 @@
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*pool);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static void * get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PMC_EXT * new_pmc_ext(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 static int sweep_cb_buf(PARROT_INTERP,
     ARGMOD(Small_Object_Pool *pool),
     SHIM(int flag),
@@ -66,11 +55,6 @@
     || PARROT_ASSERT_ARG(pool)
 #define ASSERT_ARGS_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_get_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_new_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_sweep_cb_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(pool) \
@@ -100,7 +84,7 @@
 
 =over 4
 
-=item C<static void * get_free_buffer>
+=item C<void * get_free_buffer>
 
 Gets a free object or buffer from the given C<pool> and returns it.  If the
 object is larger then a standard C<PObj> structure, all additional memory is
@@ -112,7 +96,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static void *
+void *
 get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool))
 {
     ASSERT_ARGS(get_free_buffer)
@@ -302,217 +286,6 @@
 
 /*
 
-=item C<PMC * new_pmc_header>
-
-Gets a new PMC header from the PMC pool's free list. Guaranteed to return a
-valid PMC object or else Parrot will panic. Sets the necessary flags for the
-objects and initializes the PMC data pointer to C<NULL>.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC *
-new_pmc_header(PARROT_INTERP, UINTVAL flags)
-{
-    ASSERT_ARGS(new_pmc_header)
-    Small_Object_Pool * const pool = flags & PObj_constant_FLAG
-            ? interp->arena_base->constant_pmc_pool
-            : interp->arena_base->pmc_pool;
-    PMC * const pmc = (PMC *)pool->get_free_object(interp, pool);
-
-    if (!pmc)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
-            "Parrot VM: PMC allocation failed!\n");
-
-    /* clear flags, set is_PMC_FLAG */
-    if (flags & PObj_is_PMC_EXT_FLAG) {
-        flags |= PObj_is_special_PMC_FLAG;
-        pmc->pmc_ext = new_pmc_ext(interp);
-
-        if (flags & PObj_is_PMC_shared_FLAG)
-            add_pmc_sync(interp, pmc);
-    }
-    else
-        pmc->pmc_ext = NULL;
-
-    PObj_get_FLAGS(pmc) = PObj_is_PMC_FLAG|flags;
-    pmc->vtable         = NULL;
-
-#if ! PMC_DATA_IN_EXT
-    PMC_data(pmc)       = NULL;
-#endif
-
-    return pmc;
-}
-
-
-/*
-
-=item C<static PMC_EXT * new_pmc_ext>
-
-Gets a new free C<PMC_EXT> structure from the PMC_EXT pool. A pointer to the
-new PMC_EXT is returned. Does not check to ensure the PMC_EXT is non-null
-before it is returned (yet).
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PMC_EXT *
-new_pmc_ext(PARROT_INTERP)
-{
-    ASSERT_ARGS(new_pmc_ext)
-    Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
-    /* XXX: Should we check here to ensure the PMC_EXT is non-null
-            like we do in C<new_pmc>? */
-    return (PMC_EXT *)pool->get_free_object(interp, pool);
-}
-
-
-/*
-
-=item C<void add_pmc_ext>
-
-Obtains a new C<PMC_EXT> structure, and attaches it to the given C<PMC>.
-Sets the necessary flags associated with the PMC_EXT structure. Ensures
-that the PMC_EXT structure is marked as "alive" by the GC.
-
-=cut
-
-*/
-
-void
-add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
-{
-    ASSERT_ARGS(add_pmc_ext)
-    pmc->pmc_ext = new_pmc_ext(interp);
-    PObj_is_PMC_EXT_SET(pmc);
-
-#ifdef PARROT_GC_IMS
-    /*
-     * preserve DDD color: a simple PMC  live = black
-     *                     an aggregate  live = grey
-     * set'em black
-     */
-    if (PObj_live_TEST(pmc))
-        PObj_get_FLAGS(pmc) |= PObj_custom_GC_FLAG;
-#endif
-
-    PMC_next_for_GC(pmc) = PMCNULL;
-}
-
-
-/*
-
-=item C<void add_pmc_sync>
-
-Adds a C<Sync*> structure to the given C<PMC>. Initializes the PMC's owner
-field and the synchronization mutext. Does not check to ensure the C<Sync *> is
-non-null.
-
-=cut
-
-*/
-
-void
-add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
-{
-    ASSERT_ARGS(add_pmc_sync)
-    if (!PObj_is_PMC_EXT_TEST(pmc))
-        add_pmc_ext(interp, pmc);
-
-    /* XXX: Should we test the Sync * for non-null? should we allocate these
-            from a bufferlike pool instead of directly from the system? */
-    PMC_sync(pmc)        = mem_allocate_typed(Sync);
-    PMC_sync(pmc)->owner = interp;
-
-    MUTEX_INIT(PMC_sync(pmc)->pmc_lock);
-}
-
-
-/*
-
-=item C<STRING * new_string_header>
-
-Returns a new C<STRING> header from the string pool or the constant string
-pool. Sets default flags on the string object: C<PObj_is_string_FLAG>,
-C<PObj_is_COWable_FLAG>, and C<PObj_live_FLAG> (for GC). Initializes the data
-field of the string buffer to C<NULL>.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-STRING *
-new_string_header(PARROT_INTERP, UINTVAL flags)
-{
-    ASSERT_ARGS(new_string_header)
-    STRING * const string = (STRING *)get_free_buffer(interp,
-        (flags & PObj_constant_FLAG)
-            ? interp->arena_base->constant_string_header_pool
-            : interp->arena_base->string_header_pool);
-
-    string->strstart        = NULL;
-    PObj_get_FLAGS(string) |=
-        flags | PObj_is_string_FLAG | PObj_is_COWable_FLAG | PObj_live_FLAG;
-
-    return string;
-}
-
-
-/*
-
-=item C<Buffer * new_buffer_header>
-
-Creates and returns a new C<Buffer> from the buffer header pool.  Calls
-C<get_free_buffer> to do all the work.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Buffer *
-new_buffer_header(PARROT_INTERP)
-{
-    ASSERT_ARGS(new_buffer_header)
-    return (Buffer *)get_free_buffer(interp,
-            interp->arena_base->buffer_header_pool);
-}
-
-
-/*
-
-=item C<void * new_bufferlike_header>
-
-Returns a new buffer-like header from the appropriate sized pool.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-void *
-new_bufferlike_header(PARROT_INTERP, size_t size)
-{
-    ASSERT_ARGS(new_bufferlike_header)
-    Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
-
-    return get_free_buffer(interp, pool);
-}
-
-
-/*
-
 =item C<size_t get_max_buffer_address>
 
 Calculates the maximum buffer address and returns it. This is done by looping



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