[svn:parrot] r43361 - in branches/boehm_gc: include/parrot src/call src/gc
bacek at svn.parrot.org
bacek at svn.parrot.org
Fri Jan 1 21:04:24 UTC 2010
Author: bacek
Date: Fri Jan 1 21:04:23 2010
New Revision: 43361
URL: https://trac.parrot.org/parrot/changeset/43361
Log:
Make GC_USE_FIXED_SIZE_ALLOCATOR "public" by moving it into settings.h
Modified:
branches/boehm_gc/include/parrot/settings.h
branches/boehm_gc/src/call/context.c
branches/boehm_gc/src/gc/api.c
branches/boehm_gc/src/gc/gc_private.h
Modified: branches/boehm_gc/include/parrot/settings.h
==============================================================================
--- branches/boehm_gc/include/parrot/settings.h Fri Jan 1 21:03:31 2010 (r43360)
+++ branches/boehm_gc/include/parrot/settings.h Fri Jan 1 21:04:23 2010 (r43361)
@@ -30,7 +30,12 @@
* MS -- stop-the-world mark & sweep
* INF -- infinite memory "collector"
*/
-#define PARROT_GC_DEFAULT_TYPE MS
+#define PARROT_GC_DEFAULT_TYPE BOEHM_GC
+
+
+/* Set to 1 if we want to use the fixed-size allocator. Set to 0 if we want
+ to allocate these things using mem_sys_allocate instead */
+#define PARROT_GC_USE_FIXED_SIZE_ALLOCATOR 1
/*
* JIT/i386 can use the CGP run core for external functions instead
Modified: branches/boehm_gc/src/call/context.c
==============================================================================
--- branches/boehm_gc/src/call/context.c Fri Jan 1 21:03:31 2010 (r43360)
+++ branches/boehm_gc/src/call/context.c Fri Jan 1 21:04:23 2010 (r43361)
@@ -476,7 +476,7 @@
/* don't allocate any storage if there are no registers */
if (reg_alloc)
-#if GC_USE_FIXED_SIZE_ALLOCATOR
+#if PARROT_GC_USE_FIXED_SIZE_ALLOCATOR
ctx->registers = (Parrot_Context *)Parrot_gc_allocate_fixed_size_storage(interp, reg_alloc);
#else
ctx->registers = (Parrot_Context *)mem_sys_allocate_zeroed(reg_alloc);
@@ -544,7 +544,7 @@
return;
/* Free registers */
-#if GC_USE_FIXED_SIZE_ALLOCATOR
+#if PARROT_GC_USE_FIXED_SIZE_ALLOCATOR
Parrot_gc_free_fixed_size_storage(interp, reg_size, ctx->registers);
#else
mem_sys_free(ctx->registers);
Modified: branches/boehm_gc/src/gc/api.c
==============================================================================
--- branches/boehm_gc/src/gc/api.c Fri Jan 1 21:03:31 2010 (r43360)
+++ branches/boehm_gc/src/gc/api.c Fri Jan 1 21:04:23 2010 (r43361)
@@ -1654,7 +1654,7 @@
{
ASSERT_ARGS(Parrot_gc_allocate_pmc_attributes)
const size_t attr_size = pmc->vtable->attr_size;
-#if GC_USE_FIXED_SIZE_ALLOCATOR
+#if PARROT_GC_USE_FIXED_SIZE_ALLOCATOR
PMC_Attribute_Pool * const pool = Parrot_gc_get_attribute_pool(interp,
attr_size);
void * const attrs = Parrot_gc_get_attributes_from_pool(interp, pool);
@@ -1685,7 +1685,7 @@
if (data) {
-#if GC_USE_FIXED_SIZE_ALLOCATOR
+#if PARROT_GC_USE_FIXED_SIZE_ALLOCATOR
const size_t attr_size = pmc->vtable->attr_size;
const size_t item_size = attr_size < sizeof (void *) ? sizeof (void *) : attr_size;
PMC_Attribute_Pool ** const pools = interp->mem_pools->attrib_pools;
Modified: branches/boehm_gc/src/gc/gc_private.h
==============================================================================
--- branches/boehm_gc/src/gc/gc_private.h Fri Jan 1 21:03:31 2010 (r43360)
+++ branches/boehm_gc/src/gc/gc_private.h Fri Jan 1 21:04:23 2010 (r43361)
@@ -65,10 +65,6 @@
enough to satisfy most startup costs. */
#define GC_USE_LAZY_ALLOCATOR 1
-/* Set to 1 if we want to use the fixed-size allocator. Set to 0 if we want
- to allocate these things using mem_sys_allocate instead */
-#define GC_USE_FIXED_SIZE_ALLOCATOR 1
-
/* We're using this here to add an additional pointer to a PObj without
having to actually add an entire pointer to every PObj-alike structure
in Parrot. Astute observers may notice that if the PObj is comprised of
More information about the parrot-commits
mailing list