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

[svn:parrot] r35356 - branches/pdd09gc_part2/src

From:
chromatic
Date:
January 10, 2009 13:45
Subject:
[svn:parrot] r35356 - branches/pdd09gc_part2/src
Message ID:
20090110214535.8FA73CB9F9@x12.develooper.com
Author: chromatic
Date: Sat Jan 10 13:45:34 2009
New Revision: 35356

Modified:
   branches/pdd09gc_part2/src/headers.c

Log:
[src] Fixed some typos.  Improved some documentation.  Tidied some code.
Switched the one use of get_bufferlike_pool() over to make_bufferlike_pool(),
as the former makes it too easy to corrupt memory even in the normal case.


Modified: branches/pdd09gc_part2/src/headers.c
==============================================================================
--- branches/pdd09gc_part2/src/headers.c	(original)
+++ branches/pdd09gc_part2/src/headers.c	Sat Jan 10 13:45:34 2009
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, The Perl Foundation.
+Copyright (C) 2001-2009, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -102,9 +102,9 @@
 
 =item C<static 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 starndard C<PObj> structure, all
-additional memory is cleared.
+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
+cleared.
 
 =cut
 
@@ -120,14 +120,16 @@
 
     /* don't mess around with flags */
     PObj_bufstart(buffer) = NULL;
-    PObj_buflen(buffer) = 0;
+    PObj_buflen(buffer)   = 0;
 
     if (pool->object_size - GC_HEADER_SIZE > sizeof (PObj))
         memset(buffer + 1, 0,
                 pool->object_size - sizeof (PObj) - GC_HEADER_SIZE);
+
     return buffer;
 }
 
+
 /*
 
 =back
@@ -161,6 +163,7 @@
     return pmc_pool;
 }
 
+
 /*
 
 =item C<Small_Object_Pool * new_bufferlike_pool>
@@ -190,14 +193,14 @@
     return pool;
 }
 
+
 /*
 
 =item C<Small_Object_Pool * new_buffer_pool>
 
 Creates a new C<Small_Object_Pool> structure for managing buffer objects.
 
-Non-constant strings and plain Buffers are stored in the sized header
-pools.
+Non-constant strings and plain Buffers are stored in the sized header pools.
 
 =cut
 
@@ -220,13 +223,13 @@
     return pool;
 }
 
+
 /*
 
 =item C<Small_Object_Pool * new_string_pool>
 
-Creates a new pool for C<STRINGS> and returns it. This calls
-C<make_bufferlike_pool> internally, which in turn calls
-C<new_bufferlike_pool>.
+Creates a new pool for C<STRING>s and returns it. This calls
+C<make_bufferlike_pool> internally, which in turn calls C<new_bufferlike_pool>.
 
 =cut
 
@@ -251,13 +254,14 @@
     return pool;
 }
 
+
 /*
 
 =item C<Small_Object_Pool * make_bufferlike_pool>
 
-Make and return a bufferlike header pool for objects of a given size. If
-a pool for objects of that size already exists no new pool will be
-created, and the pointer to the existing pool is returned.
+Makes and return a bufferlike header pool for objects of a given size. If a
+pool for objects of that size already exists, no new pool will be created and
+the pointer to the existing pool is returned.
 
 =cut
 
@@ -269,13 +273,12 @@
 make_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
 {
     ASSERT_ARGS(make_bufferlike_pool)
-    const UINTVAL num_old = interp->arena_base->num_sized;
-    Small_Object_Pool **sized_pools =
-            interp->arena_base->sized_header_pools;
+    Small_Object_Pool **sized_pools = interp->arena_base->sized_header_pools;
+    const UINTVAL       num_old     = interp->arena_base->num_sized;
+    const UINTVAL       idx         =
+                            (buffer_size - sizeof (Buffer)) / sizeof (void *);
 
-    const UINTVAL idx = (buffer_size - sizeof (Buffer)) / sizeof (void *);
-
-    /* Expand the array of sized resource pools, if necessary */
+    /* Expands the array of sized resource pools, if necessary */
     if (num_old <= idx) {
         const UINTVAL num_new = idx + 1;
         /* XXX: use mem_sys_realloc_zeroed to do this easier? If we want the
@@ -290,20 +293,20 @@
         interp->arena_base->num_sized = num_new;
     }
 
-    if (sized_pools[idx] == NULL) {
+    if (sized_pools[idx] == NULL)
         sized_pools[idx] = new_bufferlike_pool(interp, buffer_size);
-    }
 
     return sized_pools[idx];
 }
 
+
 /*
 
 =item C<Small_Object_Pool * get_bufferlike_pool>
 
-Returns a bufferlike header pool for objects of a given size. Does
-not check to see if the pool already exists, so if the pool is
-non-existant, this will return an invalid pointer.
+Returns a bufferlike header pool for objects of a given size. Does not check to
+see if the pool already exists, so if the pool does not exist, this will return
+an invalid pointer.  That's bad.  Don't use this until it gets fixed.
 
 =cut
 
@@ -321,14 +324,14 @@
     return sized_pools[ (buffer_size - sizeof (Buffer)) / sizeof (void *) ];
 }
 
+
 /*
 
 =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. Set's the
-necessary flags for the objects and initializes the PMC data pointer
-to C<NULL>.
+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
 
@@ -340,8 +343,7 @@
 new_pmc_header(PARROT_INTERP, UINTVAL flags)
 {
     ASSERT_ARGS(new_pmc_header)
-    Small_Object_Pool * const pool =
-        flags & PObj_constant_FLAG
+    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);
@@ -360,21 +362,25 @@
     }
     else
         pmc->pmc_ext = NULL;
+
     PObj_get_FLAGS(pmc) = PObj_is_PMC_FLAG|flags;
-    pmc->vtable = NULL;
+    pmc->vtable         = NULL;
+
 #if ! PMC_DATA_IN_EXT
-    PMC_data(pmc) = NULL;
+    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).
+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
 
@@ -392,6 +398,7 @@
     return (PMC_EXT *)pool->get_free_object(interp, pool);
 }
 
+
 /*
 
 =item C<void add_pmc_ext>
@@ -410,6 +417,7 @@
     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
@@ -419,16 +427,18 @@
     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.
+field and the synchronization mutext. Does not check to ensure the C<Sync *> is
+non-null.
 
 =cut
 
@@ -438,24 +448,26 @@
 add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
 {
     ASSERT_ARGS(add_pmc_sync)
-    if (!PObj_is_PMC_EXT_TEST(pmc)) {
+    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
+
+    /* 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) = (Sync *)mem_internal_allocate(sizeof (*PMC_sync(pmc)));
+    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> structure 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>.
+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
 
@@ -472,21 +484,20 @@
             ? 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;
 
-    string->strstart        = NULL;
-
     return string;
 }
 
+
 /*
 
 =item C<Buffer * new_buffer_header>
 
-Creates and returns a new C<Buffer> from the buffer header pool. Does
-not check that the pointer is non-null. Calls C<get_free_buffer> to do
-all the work.
+Creates and returns a new C<Buffer> from the buffer header pool.  Calls
+C<get_free_buffer> to do all the work.
 
 =cut
 
@@ -507,8 +518,7 @@
 
 =item C<void * new_bufferlike_header>
 
-Returns a new buffer-like header from the appropriate sized pool. Does
-not check to ensure the header is non-null.
+Returns a new buffer-like header from the appropriate sized pool.
 
 =cut
 
@@ -520,21 +530,21 @@
 new_bufferlike_header(PARROT_INTERP, size_t size)
 {
     ASSERT_ARGS(new_bufferlike_header)
-    Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
+    Small_Object_Pool * const pool = make_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 through all the sized pools, and finding the pool whose
-C<end_arena_memory> field is the highest. Notice that arenas in each
-pool are not necessarily located directly next to each other in memory,
-and the last arena in the pool's list may not be located at the highest
-memory address.
+Calculates the maximum buffer address and returns it. This is done by looping
+through all the sized pools, and finding the pool whose C<end_arena_memory>
+field is the highest. Notice that arenas in each pool are not necessarily
+located directly next to each other in memory, and the last arena in the pool's
+list may not be located at the highest memory address.
 
 =cut
 
@@ -545,9 +555,9 @@
 get_max_buffer_address(PARROT_INTERP)
 {
     ASSERT_ARGS(get_max_buffer_address)
-    UINTVAL i;
-    size_t max = 0;
     Arenas * const arena_base = interp->arena_base;
+    size_t         max        = 0;
+    UINTVAL        i;
 
     for (i = 0; i < arena_base->num_sized; i++) {
         if (arena_base->sized_header_pools[i]) {
@@ -559,16 +569,17 @@
     return max;
 }
 
+
 /*
 
 =item C<size_t get_min_buffer_address>
 
-Calculates the minimum buffer address and returns it. Loops through
-all sized pools, and finds the one with the smallest
-C<start_arena_memory> field. Notice that the memory region between
-C<get_min_buffer_address> and C<get_max_buffer_address> may be
-fragmented, and parts of it may not be available for Parrot to use
-directly (such as bookkeeping data for the OS memory manager).
+Calculates the minimum buffer address and returns it. Loops through all sized
+pools, and finds the one with the smallest C<start_arena_memory> field. Notice
+that the memory region between C<get_min_buffer_address> and
+C<get_max_buffer_address> may be fragmented, and parts of it may not be
+available for Parrot to use directly (such as bookkeeping data for the OS
+memory manager).
 
 =cut
 
@@ -579,20 +590,22 @@
 get_min_buffer_address(PARROT_INTERP)
 {
     ASSERT_ARGS(get_min_buffer_address)
-    UINTVAL i;
     Arenas * const arena_base = interp->arena_base;
-    size_t min = (size_t) -1;
+    size_t         min        = (size_t) -1;
+    UINTVAL        i;
 
     for (i = 0; i < arena_base->num_sized; i++) {
-        if (arena_base->sized_header_pools[i] &&
-            arena_base->sized_header_pools[i]->start_arena_memory) {
+        if (arena_base->sized_header_pools[i]
+        &&  arena_base->sized_header_pools[i]->start_arena_memory) {
             if (arena_base->sized_header_pools[i]->start_arena_memory < min)
                 min = arena_base->sized_header_pools[i]->start_arena_memory;
         }
     }
+
     return min;
 }
 
+
 /*
 
 =item C<size_t get_max_pmc_address>
@@ -611,14 +624,14 @@
     return interp->arena_base->pmc_pool->end_arena_memory;
 }
 
+
 /*
 
 =item C<size_t get_min_pmc_address>
 
-Returns the minimum memory address used by the C<pmc_pool>. Notice that
-the memory region between C<get_min_pmc_address> and
-C<get_max_pmc_address> may be fragmented, and not all of it may be
-used directly by Parrot for storing PMCs.
+Returns the minimum memory address used by the C<pmc_pool>. Notice that the
+memory region between C<get_min_pmc_address> and C<get_max_pmc_address> may be
+fragmented, and not all of it may be used directly by Parrot for storing PMCs.
 
 =cut
 
@@ -632,6 +645,7 @@
     return interp->arena_base->pmc_pool->start_arena_memory;
 }
 
+
 /*
 
 =item C<int is_buffer_ptr>
@@ -648,24 +662,25 @@
 is_buffer_ptr(PARROT_INTERP, ARGIN(const void *ptr))
 {
     ASSERT_ARGS(is_buffer_ptr)
-    UINTVAL i;
     Arenas * const arena_base = interp->arena_base;
+    UINTVAL        i;
 
     for (i = 0; i < arena_base->num_sized; i++) {
-        if (arena_base->sized_header_pools[i] &&
-                contained_in_pool(arena_base->sized_header_pools[i], ptr))
+        if (arena_base->sized_header_pools[i]
+        &&  contained_in_pool(arena_base->sized_header_pools[i], ptr))
             return 1;
     }
 
     return 0;
 }
 
+
 /*
 
 =item C<int is_pmc_ptr>
 
-Checks that C<ptr> is actually a PMC pointer. Returns C<1> if it is,
-returns C<0> otherwise.
+Checks that C<ptr> is actually a PMC pointer. Returns C<1> if it is, C<0>
+otherwise.
 
 =cut
 
@@ -685,11 +700,11 @@
 =item C<void Parrot_initialize_header_pools>
 
 The initialization routine for the interpreter's header pools. Initializes
-pools for string headers, constant string headers, buffers, PMCs,
-PMC_EXTs, and constant PMCs.
+pools for string headers, constant string headers, buffers, PMCs, PMC_EXTs, and
+constant PMCs.
 
-The C<string_header_pool> and C<buffer_header_pool> are actually both in
-the sized pools, although no other sized pools are created here.
+The C<string_header_pool> and C<buffer_header_pool> are actually both in the
+sized pools, although no other sized pools are created here.
 
 =cut
 
@@ -699,7 +714,7 @@
 Parrot_initialize_header_pools(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_initialize_header_pools)
-    Arenas * const arena_base = interp->arena_base;
+    Arenas * const arena_base                     = interp->arena_base;
 
     /* Init the constant string header pool */
     arena_base->constant_string_header_pool       = new_string_pool(interp, 1);
@@ -707,10 +722,9 @@
 
     /* Init the buffer header pool
      *
-     * note: the buffer_header_pool and the string_header_pool are actually
-     * living in the sized_header_pools, this pool pointers are only
-     * here for faster access in new_*_header
-     */
+     * The buffer_header_pool and the string_header_pool actually live in the
+     * sized_header_pools. These pool pointers only provide faster access in
+     * new_*_header */
     arena_base->buffer_header_pool       = new_buffer_pool(interp);
     arena_base->buffer_header_pool->name = "buffer_header";
 
@@ -719,11 +733,11 @@
     arena_base->string_header_pool->name = "string_header";
 
     /* Init the PMC header pool */
-    arena_base->pmc_pool       = new_pmc_pool(interp);
-    arena_base->pmc_pool->name = "pmc";
+    arena_base->pmc_pool                 = new_pmc_pool(interp);
+    arena_base->pmc_pool->name           = "pmc";
 
     /* pmc extension buffer */
-    arena_base->pmc_ext_pool =
+    arena_base->pmc_ext_pool             =
         new_small_object_pool(sizeof (PMC_EXT), 1024);
 
 #if PARROT_GC_MS
@@ -737,6 +751,7 @@
 #else
     /* rational, consistant behavior (as yet unwritten) */
 #endif
+
     arena_base->pmc_ext_pool->name = "pmc_ext";
 
     /* constant PMCs */
@@ -746,15 +761,16 @@
        CONSTANT_PMC_HEADERS_PER_ALLOC;
 }
 
+
 /*
 
 =item C<int Parrot_forall_header_pools>
 
-Iterates through header pools, invoking the given callback function
-on each pool in the list matching the given criteria. Determines
-which pools to iterate over depending on flags passed to the function.
-Returns the callback's return value, if non-zero. A non-zero return
-value from the callback function will terminate the iteration prematurely.
+Iterates through header pools, invoking the given callback function on each
+pool in the list matching the given criteria. Determines which pools to iterate
+over depending on flags passed to the function.  Returns the callback's return
+value, if non-zero. A non-zero return value from the callback function will
+terminate the iteration prematurely.
 
 =over 4
 
@@ -767,8 +783,8 @@
 
 Only matching pools will be used. Notice that it is not possible to iterate
 over certain sets of pools using the provided flags in the single pass. For
-instance, both the PMC pool and the constant PMC pool cannot be iterated
-over in a single pass.
+instance, both the PMC pool and the constant PMC pool cannot be iterated over
+in a single pass.
 
 =item arg
 
@@ -776,8 +792,8 @@
 
 =item pool_iter_fn
 
-It is called with C<(Interp*, Small_Object_Pool *, int flag, void *arg)>
-If the function returns a non-zero value iteration will stop.
+Called with C<(Parrot_Interp, Small_Object_Pool *, int flag, void *arg)>.  If
+the function returns a non-zero value, iteration will stop.
 
 =back
 
@@ -805,7 +821,6 @@
             return ret_val;
     }
 
-
     if (flag & POOL_BUFFER) {
         INTVAL i;
 
@@ -832,13 +847,13 @@
     return 0;
 }
 
+
 /*
 
 =item C<static void free_pool>
 
-Frees a pool and all of it's arenas. Loops through the list of arenas
-backwards and returns each to the memory manager. Then, it frees the
-pool structure itself.
+Frees a pool and all of its arenas. Loops through the list of arenas backwards
+and returns each to the memory manager. Then, frees the pool structure itself.
 
 =cut
 
@@ -859,13 +874,14 @@
     mem_internal_free(pool);
 }
 
+
 /*
 
 =item C<static int sweep_cb_buf>
 
-Performs a final garbage collection sweep, and then frees the pool. Calls
-C<Parrot_gc_sweep> to perform the sweep, and C<free_pool> to free the
-pool and all it's arenas.
+Performs a final garbage collection sweep, then frees the pool. Calls
+C<Parrot_gc_sweep> to perform the sweep, and C<free_pool> to free the pool and
+all its arenas.
 
 =cut
 
@@ -884,22 +900,24 @@
         used_cow(interp, pool, 1);
     else
 #endif
+
     {
         UNUSED(arg);
         Parrot_gc_sweep(interp, pool);
         free_pool(pool);
     }
-    return 0;
 
+    return 0;
 }
 
+
 /*
 
 =item C<static int sweep_cb_pmc>
 
-Performs a garbage collection sweep of the given pmc pool, and then frees
-it. Calls C<Parrot_gc_sweep> to perform the sweep, and C<free_pool> to
-free the pool and all it's arenas. Always returns C<0>.
+Performs a garbage collection sweep of the given pmc pool, then frees it. Calls
+C<Parrot_gc_sweep> to perform the sweep, and C<free_pool> to free the pool and
+all its arenas. Always returns C<0>.
 
 =cut
 
@@ -914,14 +932,15 @@
     return 0;
 }
 
+
 /*
 
 =item C<void Parrot_destroy_header_pools>
 
-Performs a garbage collection sweep on all pools, and then frees them.
-Calls C<Parrot_forall_header_pools> to loop over all the pools, passing
-C<sweep_cb_pmc> and C<sweep_cb_buf> callback routines. Frees the array
-of sized header pointers in the C<Arenas> structure too.
+Performs a garbage collection sweep on all pools, then frees them.  Calls
+C<Parrot_forall_header_pools> to loop over all the pools, passing
+C<sweep_cb_pmc> and C<sweep_cb_buf> callback routines. Frees the array of sized
+header pointers in the C<Arenas> structure too.
 
 =cut
 
@@ -960,12 +979,13 @@
     interp->arena_base->sized_header_pools = NULL;
 }
 
+
 /*
 
 =item C<static void fix_pmc_syncs>
 
 Walks through the given arena, looking for all live and shared PMCs,
-transferring their sync values to the destionation interpreter.
+transferring their sync values to the destination interpreter.
 
 =cut
 
@@ -976,10 +996,10 @@
 {
     ASSERT_ARGS(fix_pmc_syncs)
     Small_Object_Arena *cur_arena;
-    const UINTVAL object_size = pool->object_size;
+    const UINTVAL       object_size = pool->object_size;
 
     for (cur_arena = pool->last_Arena; cur_arena; cur_arena = cur_arena->prev) {
-        PMC * p = (PMC *)((char*)cur_arena->start_objects + GC_HEADER_SIZE);
+        PMC   *p = (PMC *)((char*)cur_arena->start_objects + GC_HEADER_SIZE);
         size_t i;
 
         for (i = 0; i < cur_arena->used; i++) {
@@ -989,8 +1009,8 @@
                 else
                     Parrot_ex_throw_from_c_args(dest_interp, NULL,
                         EXCEPTION_INTERP_ERROR,
-                        "Unshared PMC still alive after interpreter \
-                        destruction. address=%p, base_type=%d\n",
+                        "Unshared PMC still alive after interpreter"
+                        "destruction. address=%p, base_type=%d\n",
                         p, p->vtable->base_type);
             }
 
@@ -999,11 +1019,12 @@
     }
 }
 
+
 /*
 
 =item C<void Parrot_merge_header_pools>
 
-Merge the header pools of C<source_interp> into those of C<dest_interp>.
+Merges the header pools of C<source_interp> into those of C<dest_interp>.
 (Used to deal with shared objects left after interpreter destruction.)
 
 =cut
@@ -1014,33 +1035,33 @@
 Parrot_merge_header_pools(ARGMOD(Interp *dest_interp), ARGIN(Interp *source_interp))
 {
     ASSERT_ARGS(Parrot_merge_header_pools)
-    UINTVAL i;
 
-    Arenas * const dest_arena = dest_interp->arena_base;
+    Arenas * const dest_arena   = dest_interp->arena_base;
     Arenas * const source_arena = source_interp->arena_base;
+    UINTVAL        i;
 
     /* heavily borrowed from forall_header_pools */
-
     fix_pmc_syncs(dest_interp, source_arena->constant_pmc_pool);
     Parrot_small_object_pool_merge(dest_interp, dest_arena->constant_pmc_pool,
             source_arena->constant_pmc_pool);
+
     fix_pmc_syncs(dest_interp, source_arena->pmc_pool);
     Parrot_small_object_pool_merge(dest_interp, dest_arena->pmc_pool,
             source_arena->pmc_pool);
+
     Parrot_small_object_pool_merge(dest_interp,
             dest_arena->constant_string_header_pool,
             source_arena->constant_string_header_pool);
+
     Parrot_small_object_pool_merge(dest_interp,
-            dest_arena->pmc_ext_pool,
-            source_arena->pmc_ext_pool);
+            dest_arena->pmc_ext_pool, source_arena->pmc_ext_pool);
 
     for (i = 0; i < source_arena->num_sized; ++i) {
-        if (!source_arena->sized_header_pools[i]) {
+        if (!source_arena->sized_header_pools[i])
             continue;
-        }
 
-        if (i >= dest_arena->num_sized ||
-            !dest_arena->sized_header_pools[i]) {
+        if (i >= dest_arena->num_sized
+        || !dest_arena->sized_header_pools[i]) {
             Small_Object_Pool *ignored = make_bufferlike_pool(dest_interp,
                     i * sizeof (void *) + sizeof (Buffer));
             UNUSED(ignored);
@@ -1053,42 +1074,6 @@
     }
 }
 
-#if 0
-
-/*
-
-=item C<void Parrot_initialize_header_pool_names>
-
-UNUSED. Sets the C<name> parameter of the various header pools to a
-Parrot string structure for the name of the pool.
-
-=cut
-
-*/
-
-void
-Parrot_initialize_header_pool_names(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_initialize_header_pool_names)
-    interp->arena_base->string_header_pool->name
-            = string_make(interp, "String Pool", strlen("String Pool"),
-            0, PObj_constant_FLAG, 0);
-    interp->arena_base->pmc_pool->name
-            = string_make(interp, "PMC Pool", strlen("PMC Pool"),
-            0, PObj_constant_FLAG, 0);
-    /* Set up names for each header pool, * now that we have a constant string
-     *
-     * * pool available to us */
-    interp->arena_base->constant_string_header_pool->name
-            =
-            string_make(interp, "Constant String Pool",
-            strlen("Constant String Pool"), 0, PObj_constant_FLAG, 0);
-    interp->arena_base->buffer_header_pool->name =
-            string_make(interp, "Generic Header Pool",
-            strlen("Generic Header Pool"), 0, PObj_constant_FLAG, 0);
-}
-
-#endif
 
 /*
 



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