Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8d14c5cbe61741e946ab3e753eddeabb9502b610
Ticket: 1310081fffffffffffffffffffffffffffffffff
Tcl_GetWideIntFromObj optimization
User & Date: muonics on 2005-10-01 07:27:46
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    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.)
    
  4. foundin changed to: "obsolete: 8.4.11"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "muonics"
  9. subsystem changed to: "10. Objects"
  10. title changed to: "Tcl_GetWideIntFromObj optimization"
  11. type changed to: "Bug"