[svn:parrot] r39676 - trunk/src/gc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Sat Jun 20 20:40:05 UTC 2009
Author: whiteknight
Date: Sat Jun 20 20:40:04 2009
New Revision: 39676
URL: https://trac.parrot.org/parrot/changeset/39676
Log:
[gc] following the lead set by Infinoid++, add a quick check to the gc to prevent allocating a pmc_ext when one has already been allocated.
Modified:
trunk/src/gc/api.c
Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c Sat Jun 20 20:24:17 2009 (r39675)
+++ trunk/src/gc/api.c Sat Jun 20 20:40:04 2009 (r39676)
@@ -325,7 +325,8 @@
{
ASSERT_ARGS(Parrot_gc_add_pmc_ext)
Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
- pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool);
+ if(!pmc->pmc_ext)
+ pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool);
if (!pmc->pmc_ext)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
"Parrot VM: PMC_EXT allocation failed!\n");
More information about the parrot-commits
mailing list