|
2005-11-29
| ||
| 21:30 | • Closed ticket [1310081fff]: Tcl_GetWideIntFromObj optimization plus 7 other ... artifact: 39cf65be9d user: dkf | |
|
2005-10-11
| ||
| 22:31 | • Ticket [1310081fff]: 1 change artifact: 93ecfee849 user: dgp | |
| 22:26 | • Ticket [1310081fff]: 1 change artifact: b3ad69a783 user: msofer | |
|
2005-10-01
| ||
| 07:27 | • New ticket [1310081fff]. artifact: 8d14c5cbe6 user: muonics | |
Tcl_GetWideIntFromObj optimization
Closed / Fixed1310081fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-10-01 07:27:46
Tcl_GetWideIntFromObj() appears to go through the
string representation for all but tclWideIntType --
even for tclIntType. Tcl_GetIntFromObj() is optimized
to deal with the internal representation already being
tclWideIntType; seems a simple fix to optimize
Tcl_GetWideIntFromObj() given that the wide int should
be at least as (if not more) wide as a long.
Index: tclObj.c
===================================================================
RCS file: /home/CVSROOT/tcl/generic/tclObj.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 tclObj.c
--- tclObj.c 23 May 2005 06:35:06 -0000 1.1.1.4
+++ tclObj.c 1 Oct 2005 07:09:29 -0000
@@ -2586,6 +2586,10 @@ Tcl_GetWideIntFromObj(interp,
objPtr, wi
*wideIntPtr = objPtr->internalRep.wideValue;
return TCL_OK;
}
+ if (objPtr->typePtr == &tclIntType) {
+ *wideIntPtr = objPtr->internalRep.longValue;
+ return TCL_OK;
+ }
result = SetWideIntFromAny(interp, objPtr);
if (result == TCL_OK) {
*wideIntPtr = objPtr->internalRep.wideValue;
(diffs are versus my local repository and 8.4.9, so
version number's off versus SF CVS, but it should be
obvious.)
msofer Ticket [1310081fff]: 1 change
[History diff]2005-10-11 22:26:09
dgp Ticket [1310081fff]: 1 change
[History diff]2005-10-11 22:31:11
dkfplain2005-11-29 21:30:43
Logged In: YES user_id=79902 To maintain the 8.4 behaviour, must cast type to wideInt. Luckily, this is safe. This means that your patch is not accepted itself, but something recognizably similar is. 8.5 has bigints, and is therefore an (effectively) unrelated codebase.
Log in (anonymous is fine) to add a comment.