[svn:parrot] r43785 - in branches/gc_encapsulate_part1: include/parrot src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Mon Feb 8 14:18:42 UTC 2010


Author: bacek
Date: Mon Feb  8 14:18:42 2010
New Revision: 43785
URL: https://trac.parrot.org/parrot/changeset/43785

Log:
Remove unused, non-public Parrot_gc_get_pmc_index function

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

Modified: branches/gc_encapsulate_part1/include/parrot/gc_api.h
==============================================================================
--- branches/gc_encapsulate_part1/include/parrot/gc_api.h	Mon Feb  8 13:53:34 2010	(r43784)
+++ branches/gc_encapsulate_part1/include/parrot/gc_api.h	Mon Feb  8 14:18:42 2010	(r43785)
@@ -233,10 +233,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*s);
 
-int Parrot_gc_get_pmc_index(PARROT_INTERP, ARGIN(PMC* pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 size_t Parrot_gc_headers_alloc_since_last_collect(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -388,9 +384,6 @@
 #define ASSERT_ARGS_Parrot_gc_free_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(s))
-#define ASSERT_ARGS_Parrot_gc_get_pmc_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_Parrot_gc_headers_alloc_since_last_collect \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))

Modified: branches/gc_encapsulate_part1/src/gc/api.c
==============================================================================
--- branches/gc_encapsulate_part1/src/gc/api.c	Mon Feb  8 13:53:34 2010	(r43784)
+++ branches/gc_encapsulate_part1/src/gc/api.c	Mon Feb  8 14:18:42 2010	(r43785)
@@ -1208,52 +1208,6 @@
 
 /*
 
-=item C<int Parrot_gc_get_pmc_index(PARROT_INTERP, PMC* pmc)>
-
-Gets the index of the PMC in the pool. The first PMC in the first pool is 1,
-the second is 2, etc.
-
-=cut
-
-*/
-
-int
-Parrot_gc_get_pmc_index(PARROT_INTERP, ARGIN(PMC* pmc))
-{
-    ASSERT_ARGS(Parrot_gc_get_pmc_index)
-    UINTVAL id = 1;     /* first PMC in first arena */
-    Fixed_Size_Arena *arena;
-    Fixed_Size_Pool *pool;
-
-    pool = interp->mem_pools->pmc_pool;
-    for (arena = pool->last_Arena; arena; arena = arena->prev) {
-        const ptrdiff_t ptr_diff = (ptrdiff_t)pmc - (ptrdiff_t)arena->start_objects;
-        if (ptr_diff >= 0 && ptr_diff <
-                (ptrdiff_t)(arena->used * pool->object_size)) {
-            PARROT_ASSERT(ptr_diff % pool->object_size == 0);
-            id += ptr_diff / pool->object_size;
-            return id;
-        }
-        id += arena->total_objects;
-    }
-
-    pool = interp->mem_pools->constant_pmc_pool;
-    for (arena = pool->last_Arena; arena; arena = arena->prev) {
-        const ptrdiff_t ptr_diff = (ptrdiff_t)pmc - (ptrdiff_t)arena->start_objects;
-        if (ptr_diff >= 0 && ptr_diff <
-                (ptrdiff_t)(arena->used * pool->object_size)) {
-            PARROT_ASSERT(ptr_diff % pool->object_size == 0);
-            id += ptr_diff / pool->object_size;
-            return id;
-        }
-        id += arena->total_objects;
-    }
-
-    Parrot_ex_throw_from_c_args(interp, NULL, 1, "Couldn't find PMC in arenas");
-}
-
-/*
-
 =item C<int Parrot_gc_active_sized_buffers(PARROT_INTERP)>
 
 Returns the number of actively used sized buffers.


More information about the parrot-commits mailing list