diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | generic/tclResult.c | 14 |
2 files changed, 21 insertions, 1 deletions
@@ -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 */ } /* |