[svn:parrot] r40976 - in trunk: include/parrot src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Fri Sep 4 20:52:57 UTC 2009


Author: bacek
Date: Fri Sep  4 20:52:56 2009
New Revision: 40976
URL: https://trac.parrot.org/parrot/changeset/40976

Log:
[cage] Remove CHUNCKED_CTX_MEMORY and Parrot_gc_context. Contexts are
GCable objects now.

Modified:
   trunk/include/parrot/interpreter.h
   trunk/include/parrot/register.h
   trunk/src/gc/alloc_register.c
   trunk/src/gc/api.c

Modified: trunk/include/parrot/interpreter.h
==============================================================================
--- trunk/include/parrot/interpreter.h	Fri Sep  4 20:48:48 2009	(r40975)
+++ trunk/include/parrot/interpreter.h	Fri Sep  4 20:52:56 2009	(r40976)
@@ -207,21 +207,9 @@
 #define CURRENT_CONTEXT(interp) ((interp)->ctx)
 
 
-#define CHUNKED_CTX_MEM 0           /* no longer works, but will be reinstated
-                                     * some day; see src/register.c for details.
-                                    */
-
 typedef struct _context_mem {
-#if CHUNKED_CTX_MEM
-    char *data;                     /* ctx + register store */
-    char *free;                     /* free to allocate */
-    char *threshold;                /* continuation threshold */
-    struct _context_mem *prev;      /* previous allocated area */
-#else
     void **free_list;               /* array of free-lists, per size free slots */
     int n_free_slots;               /* amount of allocated */
-#endif
-
 } context_mem;
 
 

Modified: trunk/include/parrot/register.h
==============================================================================
--- trunk/include/parrot/register.h	Fri Sep  4 20:48:48 2009	(r40975)
+++ trunk/include/parrot/register.h	Fri Sep  4 20:52:56 2009	(r40976)
@@ -77,10 +77,6 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void parrot_gc_context(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
 FLOATVAL * Parrot_pcc_get_FLOATVAL_reg(PARROT_INTERP,
     ARGIN(PMC *ctx),
@@ -190,8 +186,6 @@
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_clear_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_pcc_get_FLOATVAL_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)

Modified: trunk/src/gc/alloc_register.c
==============================================================================
--- trunk/src/gc/alloc_register.c	Fri Sep  4 20:48:48 2009	(r40975)
+++ trunk/src/gc/alloc_register.c	Fri Sep  4 20:52:56 2009	(r40976)
@@ -78,34 +78,6 @@
 
 */
 
-/*
-=head2 Context and register frame allocation
-
-There are two allocation strategies: chunked memory and malloced with a free
-list.
-
- CHUNKED_CTX_MEM = 1
-
-C<ctx_mem.data> is a pointer to an allocated chunk of memory.  The pointer
-C<ctx_mem.free> holds the next usable location. With (full) continuations the
-C<ctx_mem.free> pointer can't be moved below the C<ctx_mem.threshold>, which is
-the highest context pointer of all active continuations.
-
-[the code for this is incomplete; it had suffered some bit-rot and was
-getting in the way of maintaining the other case.  -- rgr, 4-Feb-06.]
-
-RT #46177 GC has to lower this threshold when collecting continuations.
-
- CHUNKED_CTX_MEM = 0
-
-Context/register memory is malloced. C<ctx_mem.free> is used as a free list of
-reusable items.
-
-=cut
-
-*/
-
-#define CTX_ALLOC_SIZE 0x20000
 
 #define ALIGNED_CTX_SIZE (((sizeof (Parrot_Context) + NUMVAL_SIZE - 1) \
         / NUMVAL_SIZE) * NUMVAL_SIZE)
@@ -130,10 +102,6 @@
         / SLOT_CHUNK_SIZE) * SLOT_CHUNK_SIZE)
 #define CALCULATE_SLOT_NUM(size) ((size) / SLOT_CHUNK_SIZE)
 
-#if CHUNKED_CTX_MEM
- #  error "Non-working code removed."
-#endif
-
 /*
 
 =head2 Context and Register Allocation Functions
@@ -174,36 +142,6 @@
 
 /*
 
-=item C<void parrot_gc_context(PARROT_INTERP)>
-
-Cleans up dead context memory; called by the garbage collector.  This only
-applies in the chunked context memory scheme.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-parrot_gc_context(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_context)
-#if CHUNKED_CTX_MEM
-    Parrot_Context ctx;
-    ASSERT_ARGS(parrot_gc_context)
-
-    if (!interp->ctx_mem.threshold)
-        return;
-    LVALUE_CAST(char *, ctx.bp) = interp->ctx_mem.threshold
-                                - sizeof (parrot_regs_t);
-#else
-    UNUSED(interp);
-#endif
-}
-
-
-/*
-
 =item C<static void clear_regs(PARROT_INTERP, PMC *pmcctx)>
 
 Clears all registers in a context.  PMC and STRING registers contain PMCNULL

Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c	Fri Sep  4 20:48:48 2009	(r40975)
+++ trunk/src/gc/api.c	Fri Sep  4 20:52:56 2009	(r40976)
@@ -793,7 +793,6 @@
 {
     ASSERT_ARGS(Parrot_gc_mark_and_sweep)
     interp->arena_base->do_gc_mark(interp, flags);
-    parrot_gc_context(interp);
 }
 
 /*


More information about the parrot-commits mailing list