[svn:parrot] r41999 - in trunk/src: call pmc
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Wed Oct 21 23:03:59 UTC 2009
Author: chromatic
Date: Wed Oct 21 23:03:57 2009
New Revision: 41999
URL: https://trac.parrot.org/parrot/changeset/41999
Log:
[PCC] Made the Context PMC used the fixed-sized allocator for its contained
Context struct. This was always the intent of this code, but as the
GC_USE_FIXED_SIZE_ALLOCATOR definition is in the private GC header file, it was
never visible here. This gives a 2.339% performance improvement in the fib.pir
benchmark.
Modified:
trunk/src/call/context.c
trunk/src/pmc/context.pmc
Modified: trunk/src/call/context.c
==============================================================================
--- trunk/src/call/context.c Wed Oct 21 22:44:25 2009 (r41998)
+++ trunk/src/call/context.c Wed Oct 21 23:03:57 2009 (r41999)
@@ -428,11 +428,7 @@
const size_t to_alloc = reg_alloc + ALIGNED_CTX_SIZE;
-#ifdef GC_USE_FIXED_SIZE_ALLOCATOR
ctx = (Parrot_Context *)Parrot_gc_allocate_fixed_size_storage(interp, to_alloc);
-#else
- ctx = (Parrot_Context *)mem_sys_allocate(to_alloc);
-#endif
ctx->n_regs_used[REGNO_INT] = number_regs_used[REGNO_INT];
ctx->n_regs_used[REGNO_NUM] = number_regs_used[REGNO_NUM];
Modified: trunk/src/pmc/context.pmc
==============================================================================
--- trunk/src/pmc/context.pmc Wed Oct 21 22:44:25 2009 (r41998)
+++ trunk/src/pmc/context.pmc Wed Oct 21 23:03:57 2009 (r41999)
@@ -105,13 +105,10 @@
if (!ctx)
return;
-#ifdef GC_USE_FIXED_SIZE_ALLOCATOR
Parrot_gc_free_fixed_size_storage(interp,
Parrot_pcc_calculate_context_size(INTERP, ctx->n_regs_used),
ctx);
-#else
- mem_sys_free(ctx);
-#endif
+
PMC_data(SELF) = NULL;
}
More information about the parrot-commits
mailing list