[svn:parrot] r41881 - branches/pcc_reapply/src/call
bacek at svn.parrot.org
bacek at svn.parrot.org
Thu Oct 15 09:59:37 UTC 2009
Author: bacek
Date: Thu Oct 15 09:59:36 2009
New Revision: 41881
URL: https://trac.parrot.org/parrot/changeset/41881
Log:
Preallocate string_sig in Parrot_pcc_build_sig_object_from_op
Modified:
branches/pcc_reapply/src/call/args.c
Modified: branches/pcc_reapply/src/call/args.c
==============================================================================
--- branches/pcc_reapply/src/call/args.c Thu Oct 15 09:34:07 2009 (r41880)
+++ branches/pcc_reapply/src/call/args.c Thu Oct 15 09:59:36 2009 (r41881)
@@ -481,7 +481,11 @@
INTVAL arg_index;
INTVAL arg_count = VTABLE_elements(interp, raw_sig);
PMC *ctx = CURRENT_CONTEXT(interp);
- STRING *string_sig = Parrot_str_new(interp, "", 0);
+ /*
+ * Preallocate some buffer for string signature.
+ * Parrot_str_new will allocate proper size
+ */
+ STRING *string_sig = Parrot_str_new(interp, NULL, arg_count);
if (PMC_IS_NULL(signature))
call_object = pmc_new(interp, enum_class_CallSignature);
More information about the parrot-commits
mailing list