[svn:parrot] r43362 - branches/boehm_gc/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Fri Jan 1 21:04:59 UTC 2010


Author: bacek
Date: Fri Jan  1 21:04:57 2010
New Revision: 43362
URL: https://trac.parrot.org/parrot/changeset/43362

Log:
Don't use FixedSizeAllocator in CallContext if FSA is disabled.

Modified:
   branches/boehm_gc/src/pmc/callcontext.pmc

Modified: branches/boehm_gc/src/pmc/callcontext.pmc
==============================================================================
--- branches/boehm_gc/src/pmc/callcontext.pmc	Fri Jan  1 21:04:23 2010	(r43361)
+++ branches/boehm_gc/src/pmc/callcontext.pmc	Fri Jan  1 21:04:57 2010	(r43362)
@@ -40,8 +40,6 @@
 #define CELL_PMC(c)     UNTAG_CELL(c)->u.p
 
 #define NEXT_CELL(c) UNTAG_CELL(c)->next
-#define FREE_CELL(i, c) \
-    Parrot_gc_free_fixed_size_storage((i), sizeof (Pcc_cell), (UNTAG_CELL(c)))
 
 #define CELL_TYPE_MASK(c) (PTR2INTVAL(c)) & 3
 #define INTCELL    0
@@ -61,8 +59,17 @@
 #define SET_CELL_PMC(c) \
         INTVAL2PTR(Pcc_cell *, PTR2INTVAL(UNTAG_CELL(c)) | PMCCELL)
 
-#define ALLOC_CELL(i) \
-    (Pcc_cell *)Parrot_gc_allocate_fixed_size_storage((i), sizeof (Pcc_cell))
+#if PARROT_GC_USE_FIXED_SIZE_ALLOCATOR
+#  define ALLOC_CELL(i) \
+     (Pcc_cell *)Parrot_gc_allocate_fixed_size_storage((i), sizeof (Pcc_cell))
+#  define FREE_CELL(i, c) \
+     Parrot_gc_free_fixed_size_storage((i), sizeof (Pcc_cell), (UNTAG_CELL(c)))
+#else
+#  define ALLOC_CELL(i) \
+     (Pcc_cell *)mem_sys_allocate_zeroed(sizeof (Pcc_cell))
+#  define FREE_CELL(i, c) \
+     mem_sys_free(UNTAG_CELL(c))
+#endif
 
 #define INIT_CELL_INT(c)    INTVAL2PTR(Pcc_cell *, PTR2INTVAL(c) | INTCELL)
 #define INIT_CELL_FLOAT(c)  INTVAL2PTR(Pcc_cell *, PTR2INTVAL(c) | FLOATCELL)


More information about the parrot-commits mailing list