[svn:parrot] r38476 - trunk/src
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Tue May 5 02:20:48 UTC 2009
Author: chromatic
Date: Tue May 5 02:20:48 2009
New Revision: 38476
URL: https://trac.parrot.org/parrot/changeset/38476
Log:
[oo] Reduced the number of PMCs created in Parrot_ComputeMRO_C3, which is a
modest optimization.
Modified:
trunk/src/oo.c
Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c Tue May 5 01:19:03 2009 (r38475)
+++ trunk/src/oo.c Tue May 5 02:20:48 2009 (r38476)
@@ -1101,7 +1101,7 @@
{
ASSERT_ARGS(Parrot_ComputeMRO_C3)
PMC *result;
- PMC * const merge_list = pmc_new(interp, enum_class_ResizablePMCArray);
+ PMC *merge_list = PMCNULL;
PMC *immediate_parents;
int i, parent_count;
@@ -1131,6 +1131,10 @@
if (PMC_IS_NULL(lin))
return PMCNULL;
+ /* instantiated lazily */
+ if (PMC_IS_NULL(merge_list))
+ merge_list = pmc_new(interp, enum_class_ResizablePMCArray);
+
VTABLE_push_pmc(interp, merge_list, lin);
}
More information about the parrot-commits
mailing list