summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-11-23 00:12:46 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-11-23 00:12:46 (GMT)
commitc3c073a77aa192334001c69c623b4a79168fa7cc (patch)
treee204a79e13d4a8e43b4da41aea237cda64c38487
parenta9978f9939fde53bb358508c8955974f11790c46 (diff)
downloadtcl-c3c073a77aa192334001c69c623b4a79168fa7cc.zip
tcl-c3c073a77aa192334001c69c623b4a79168fa7cc.tar.gz
tcl-c3c073a77aa192334001c69c623b4a79168fa7cc.tar.bz2
Remove call to Tcl_GetStringResult to speed up processing of [$canv postscript]
and other repeated callers of Tcl_AppendResult(). [Patch 1041072]
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclResult.c14
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ce0585d..3c7651f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-11-23 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tclResult.c (Tcl_AppendResultVA): Remove call to
+ Tcl_GetStringResult to speed up repeated calls to Tcl_AppendResult
+ with the side effect that code that wants to access interp->result
+ should always call Tcl_GetStringResult first. See [Patch 1041072]
+ discussion for more details.
+
2004-11-22 Mo DeJong <mdejong@users.sourceforge.net>
* unix/configure: Regen.
diff --git a/generic/tclResult.c b/generic/tclResult.c
index c549330..28f994d 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.22 2004/11/13 00:19:10 dgp Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.23 2004/11/23 00:12:57 dkf Exp $
*/
#include "tclInt.h"
@@ -630,10 +630,22 @@ Tcl_AppendResultVA(interp, argList)
Tcl_AppendStringsToObjVA(objPtr, argList);
Tcl_SetObjResult(interp, objPtr);
/*
+ * Strictly we should call Tcl_GetStringResult(interp) here to
+ * make sure that interp->result is correct according to the old
+ * contract, but that makes the performance of much code (e.g. in
+ * Tk) absolutely awful. So we leave it out; code that really
+ * wants interp->result can just insert the calls to
+ * Tcl_GetStringResult() itself. [Patch 1041072 discussion]
+ */
+
+#ifdef USE_DIRECT_INTERP_RESULT_ACCESS
+ /*
* Ensure that the interp->result is legal so old Tcl 7.* code
* still works. There's still embarrasingly much of it about...
*/
+
(void) Tcl_GetStringResult(interp);
+#endif /* USE_DIRECT_INTERP_RESULT_ACCESS */
}
/*