Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-330-336 Excluding Merge-Ins
This is equivalent to a diff from 76eaf9a16b to 91ee06dae2
2017-11-03
| ||
18:56 | TIPs 330 & 336 changes to Tcl 9 Implementation check-in: 07f5802714 user: dgp tags: trunk | |
2017-11-01
| ||
21:05 | Fix bug 3c32a3f8bd, segmentation fault in TclOO.c/ReleaseClassContents() for a class mixed into one ... check-in: 5f178e7f03 user: pooryorick tags: trunk | |
14:46 | TIP 422 implementation (rebase of branch novem-remove-va to trunk). check-in: e090a04f00 user: dgp tags: tip-422 | |
2017-10-31
| ||
09:48 | Simplify implementation of Tcl_SaveResult/Tcl_RestoreResult/Tcl_DiscardResult by no longer assuming ... Closed-Leaf check-in: 91ee06dae2 user: jan.nijtmans tags: tip-330-336 | |
2017-10-30
| ||
15:35 | tidy? check-in: cc31c47dd3 user: dgp tags: tip-330-336 | |
14:56 | Patch to make changes to Tcl 9 prescribed by TIPs 330 and 336. This makes the Tcl_Interp struct full... check-in: 70e9e38504 user: dgp tags: tip-330-336 | |
14:01 | Preliminary (non working at this point) implementation of tip479 check-in: c8c3341810 user: hypnotoad tags: tip479 | |
12:41 | Rebase tip-278 branch to workaround CVS conversion woes. Closed-Leaf check-in: 8103b8c9fd user: dgp tags: tip-278 | |
12:08 | merge trunk Closed-Leaf check-in: 42c669a1e0 user: dgp tags: tip-278 | |
12:03 | merge trunk check-in: bc43c864d7 user: dgp tags: tip-445 | |
12:02 | merge trunk Closed-Leaf check-in: 848a10e460 user: dgp tags: tip-345 | |
12:02 | merge trunk Closed-Leaf check-in: a2d4cd2f93 user: dgp tags: tip-114 | |
08:47 | Experimental branch meant to eliminate the "wideint" type, just merge it to a single "int" type. No ... check-in: c2abe1efd0 user: jan.nijtmans tags: no-wideint | |
05:25 | merge bug-fc1409fc91. check-in: 76eaf9a16b user: pooryorick tags: trunk | |
05:19 | Fix for issue 9fd5c629c1, TclOO - aborts when a trace on command deletion deletes the object's names... Closed-Leaf check-in: bee7f97ad6 user: pooryorick tags: bug-fc1409fc91 | |
03:23 | merge 8.6 check-in: 0c0de52be7 user: dgp tags: trunk | |
Changes to doc/Interp.3.
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - - - - - - - - - - - - - | structure. Callers of \fBTcl_CreateInterp\fR should use this pointer as an opaque token, suitable for nothing other than passing back to other routines in the Tcl interface. Accessing fields directly through the pointer as described below is no longer supported. The supported public routines \fBTcl_SetResult\fR, \fBTcl_GetResult\fR, \fBTcl_SetErrorLine\fR, \fBTcl_GetErrorLine\fR must be used instead. .PP |
︙ |
Changes to doc/SaveResult.3.
︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + - + | value may then be passed back to one of \fBTcl_RestoreInterpState\fR or \fBTcl_DiscardInterpState\fR, depending on whether the interp state is to be restored. So long as one of the latter two routines is called, Tcl will take care of memory management. .PP The second triplet stores the snapshot of only the interpreter result (not its complete state) in memory allocated by the caller. |
︙ |
Changes to doc/SetResult.3.
︙ | |||
193 194 195 196 197 198 199 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | - - - - - - - - - - - - - | \fBTcl_FreeResult\fR performs part of the work of \fBTcl_ResetResult\fR. It frees up the memory associated with \fIinterp\fR's result. It also sets \fIinterp->freeProc\fR to zero, but does not change \fIinterp->result\fR or clear error state. \fBTcl_FreeResult\fR is most commonly used when a procedure is about to replace one result value with another. |
︙ |
Changes to generic/tcl.h.
︙ | |||
488 489 490 491 492 493 494 | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | * "real" definition in tclInt.h. * * Note: Tcl_ObjCmdProc functions do not directly set result and freeProc. * Instead, they set a Tcl_Obj member in the "real" structure that can be * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). */ |
︙ | |||
669 670 671 672 673 674 675 | 637 638 639 640 641 642 643 644 645 646 647 648 649 650 | - - | #define TCL_OK 0 #define TCL_ERROR 1 #define TCL_RETURN 2 #define TCL_BREAK 3 #define TCL_CONTINUE 4 |
︙ | |||
855 856 857 858 859 860 861 | 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 | - + - - + - - - - - - - - - + | void Tcl_IncrRefCount(Tcl_Obj *objPtr); void Tcl_DecrRefCount(Tcl_Obj *objPtr); int Tcl_IsShared(Tcl_Obj *objPtr); /* *---------------------------------------------------------------------------- |
︙ |
Changes to generic/tclBasic.c.
︙ | |||
506 507 508 509 510 511 512 | 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | - - - + + + - - - + + | * (whose name is ""; an alias is "::"). This also initializes the Tcl * object type table and other object management code. */ iPtr = ckalloc(sizeof(Interp)); interp = (Tcl_Interp *) iPtr; |
︙ | |||
570 571 572 573 574 575 576 | 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | - - - - - - | Tcl_IncrRefCount(iPtr->ecVar); iPtr->returnLevel = 1; iPtr->returnCode = TCL_OK; iPtr->rootFramePtr = NULL; /* Initialise as soon as :: is available */ iPtr->lookupNsPtr = NULL; |
︙ | |||
604 605 606 607 608 609 610 | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | - - - | iPtr->activeCmdTracePtr = NULL; iPtr->activeInterpTracePtr = NULL; iPtr->assocData = NULL; iPtr->execEnvPtr = NULL; /* Set after namespaces initialized. */ iPtr->emptyObjPtr = Tcl_NewObj(); /* Another empty object. */ Tcl_IncrRefCount(iPtr->emptyObjPtr); |
︙ | |||
716 717 718 719 720 721 722 | 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | - - - - - - | statsPtr->numLiteralsCreated = 0; statsPtr->totalLitStringBytes = 0.0; statsPtr->currentLitStringBytes = 0.0; memset(statsPtr->literalCount, 0, sizeof(statsPtr->literalCount)); #endif /* TCL_COMPILE_STATS */ |
︙ | |||
1517 1518 1519 1520 1521 1522 1523 | 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 | - | /* * Free up the result *after* deleting variables, since variable deletion * could have transferred ownership of the result string to Tcl. */ Tcl_FreeResult(interp); |
︙ | |||
1539 1540 1541 1542 1543 1544 1545 | 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | - - - - - - | Tcl_DecrRefCount(iPtr->upLiteral); Tcl_DecrRefCount(iPtr->callLiteral); Tcl_DecrRefCount(iPtr->innerLiteral); Tcl_DecrRefCount(iPtr->innerContext); if (iPtr->returnOpts) { Tcl_DecrRefCount(iPtr->returnOpts); } |
︙ | |||
2478 2479 2480 2481 2482 2483 2484 | 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 | - + | * "Wrapper" Tcl_CmdProc used to call an existing object-based * Tcl_ObjCmdProc if no string-based function exists for a command. A * pointer to this function is stored as the Tcl_CmdProc in a Command * structure. It simply turns around and calls the object Tcl_ObjCmdProc * in the Command structure. * * Results: |
︙ | |||
2518 2519 2520 2521 2522 2523 2524 | 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 | - - - - - - - | if (cmdPtr->objProc != NULL) { result = cmdPtr->objProc(cmdPtr->objClientData, interp, argc, objv); } else { result = Tcl_NRCallObjProc(interp, cmdPtr->nreProc, cmdPtr->objClientData, argc, objv); } |
︙ | |||
3829 3830 3831 3832 3833 3834 3835 | 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 | - + - - + + | * it was not deleted and if the nesting level is not too high. * * Results: * The return value is TCL_OK if it the interpreter is ready, TCL_ERROR * otherwise. * * Side effects: |
︙ | |||
4422 4423 4424 4425 4426 4427 4428 | 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 | - - - - - - - - - - - - - - - | TclNRRunCallbacks( Tcl_Interp *interp, int result, struct NRE_callback *rootPtr) /* All callbacks down to rootPtr not inclusive * are to be run. */ { |
︙ | |||
5907 5908 5909 5910 5911 5912 5913 | 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 | - + - - - - - - - - - | #undef Tcl_Eval int Tcl_Eval( Tcl_Interp *interp, /* Token for command interpreter (returned by * previous call to Tcl_CreateInterp). */ const char *script) /* Pointer to TCL command to execute. */ { |
︙ | |||
6339 6340 6341 6342 6343 6344 6345 | 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 | - - - | *ptr = 0; } else { exprPtr = Tcl_NewStringObj(exprstring, -1); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprLongObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); |
︙ | |||
6368 6369 6370 6371 6372 6373 6374 | 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 | - - - | *ptr = 0.0; } else { exprPtr = Tcl_NewStringObj(exprstring, -1); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprDoubleObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); /* Discard the expression object. */ |
︙ | |||
6396 6397 6398 6399 6400 6401 6402 | 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 | - - - - - - - - | } else { int result; Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, -1); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprBooleanObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); |
︙ | |||
6718 6719 6720 6721 6722 6723 6724 | 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 | - - - - - - | code = Tcl_ExprObj(interp, exprObj, &resultPtr); Tcl_DecrRefCount(exprObj); if (code == TCL_OK) { Tcl_SetObjResult(interp, resultPtr); Tcl_DecrRefCount(resultPtr); } } |
︙ | |||
6830 6831 6832 6833 6834 6835 6836 | 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 | - - - - - - - - - - - - + - | /* * If we are just starting to log an error, errorInfo is initialized from * the error message in the interpreter's result. */ iPtr->flags |= ERR_LEGACY_COPY; if (iPtr->errorInfo == NULL) { |
︙ | |||
6920 6921 6922 6923 6924 6925 6926 | 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 | - + | * Tcl_VarEval -- * * Given a variable number of string arguments, concatenate them all * together and execute the result as a Tcl command. * * Results: * A standard Tcl return result. An error message or other result may be |
︙ |
Changes to generic/tclDecls.h.
︙ | |||
3884 3885 3886 3887 3888 3889 3890 | 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 | - - + + - - + + - + | Tcl_EvalEx(interp, objPtr, -1, 0) #undef Tcl_GlobalEval #define Tcl_GlobalEval(interp, objPtr) \ Tcl_EvalEx(interp, objPtr, -1, TCL_EVAL_GLOBAL) #undef Tcl_SaveResult #define Tcl_SaveResult(interp, statePtr) \ do { \ |
︙ |
Changes to generic/tclHistory.c.
︙ | |||
69 70 71 72 73 74 75 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - - - - - - - | * Call Tcl_RecordAndEvalObj to do the actual work. */ cmdPtr = Tcl_NewStringObj(cmd, -1); Tcl_IncrRefCount(cmdPtr); result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags); |
︙ |
Changes to generic/tclInt.h.
︙ | |||
1769 1770 1771 1772 1773 1774 1775 | 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 | - - - - - - - - + + + + + + + + - - - - - - + - - - + - - - - - - - - - - - - + + + + + + + + + | * variable storage. Primary responsibility for this data structure is in * tclBasic.c, but almost every Tcl source file uses something in here. *---------------------------------------------------------------- */ typedef struct Interp { /* |
︙ | |||
1853 1854 1855 1856 1857 1858 1859 | 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 | - - - - - - - - - - - - - - - - - - - | * or NULL if no active traces. */ int returnCode; /* [return -code] parameter. */ CallFrame *rootFramePtr; /* Global frame pointer for this * interpreter. */ Namespace *lookupNsPtr; /* Namespace to use ONLY on the next * TCL_EVAL_INVOKE call to Tcl_EvalObjv. */ |
︙ | |||
1894 1895 1896 1897 1898 1899 1900 | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 | - | int cmdCount; /* Total number of times a command procedure * has been called for this interpreter. */ int evalFlags; /* Flags to control next call to Tcl_Eval. * Normally zero, but may be set before * calling Tcl_Eval. See below for valid * values. */ |
︙ | |||
1932 1933 1934 1935 1936 1937 1938 | 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 | - - - - - - | struct ExecEnv *execEnvPtr; /* Execution environment for Tcl bytecode * execution. Contains a pointer to the Tcl * evaluation stack. */ Tcl_Obj *emptyObjPtr; /* Points to an object holding an empty * string. Returned by Tcl_ObjSetVar2 when * variable traces change a variable in a * gross way. */ |
︙ |
Changes to generic/tclLoad.c.
︙ | |||
466 467 468 469 470 471 472 473 474 475 476 477 478 479 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | + + + + + + + + + + + | /* * Test for whether the initialization failed. If so, transfer the error * from the target interpreter to the originating one. */ if (code != TCL_OK) { Interp *iPtr = (Interp *) target; if (iPtr->legacyResult && !iPtr->legacyFreeProc) { /* * A call to Tcl_InitStubs() determined the caller extension and * this interp are incompatible in their stubs mechanisms, and * recorded the error in the oldest legacy place we have to do so. */ Tcl_SetObjResult(target, Tcl_NewStringObj(iPtr->legacyResult, -1)); iPtr->legacyResult = NULL; iPtr->legacyFreeProc = (void (*) (void))-1; } Tcl_TransferResult(target, code, interp); goto done; } /* * Record the fact that the package has been loaded in the target * interpreter. |
︙ |
Changes to generic/tclResult.c.
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - - - | /* * Function prototypes for local functions in this file: */ static Tcl_Obj ** GetKeys(void); static void ReleaseKeys(ClientData clientData); static void ResetObjResult(Interp *iPtr); |
︙ | |||
243 244 245 246 247 248 249 | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | /* * Move the result object into the save state. Note that we don't need to * change its refcount because we're moving it, not adding a new * reference. Put an empty object into the interpreter. */ |
︙ | |||
314 315 316 317 318 319 320 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Tcl_Interp *interp, /* Interpreter being restored. */ Tcl_SavedResult *statePtr) /* State returned by Tcl_SaveResult. */ { Interp *iPtr = (Interp *) interp; Tcl_ResetResult(interp); |
︙ | |||
378 379 380 381 382 383 384 | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | - + - - - - - - - - | */ #undef Tcl_DiscardResult void Tcl_DiscardResult( Tcl_SavedResult *statePtr) /* State returned by Tcl_SaveResult. */ { |
︙ | |||
416 417 418 419 420 421 422 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | - - - - - + + - - - - - - + - - - - - - - + - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - | * return value. */ register char *result, /* Value to be returned. If NULL, the result * is set to an empty string. */ Tcl_FreeProc *freeProc) /* Gives information about the string: * TCL_STATIC, TCL_VOLATILE, or the address of * a Tcl_FreeProc such as free. */ { |
︙ | |||
484 485 486 487 488 489 490 | 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | - + - - - - - - - - - - - - | */ const char * Tcl_GetStringResult( register Tcl_Interp *interp)/* Interpreter whose result to return. */ { Interp *iPtr = (Interp *) interp; |
︙ | |||
538 539 540 541 542 543 544 | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | - - - - - - - - - - - - - - - - - | /* * We wait until the end to release the old object result, in case we are * setting the result to itself. */ TclDecrRefCount(oldObjResult); |
︙ | |||
583 584 585 586 587 588 589 | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | - - - - - - - - - - - - - - - - - - - - - - - - - - - | */ Tcl_Obj * Tcl_GetObjResult( Tcl_Interp *interp) /* Interpreter whose result to return. */ { register Interp *iPtr = (Interp *) interp; |
︙ | |||
647 648 649 650 651 652 653 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | - - - - - - - - - - - - - - - - - | Tcl_Obj *objPtr = Tcl_GetObjResult(interp); if (Tcl_IsShared(objPtr)) { objPtr = Tcl_DuplicateObj(objPtr); } Tcl_AppendStringsToObjVA(objPtr, argList); Tcl_SetObjResult(interp, objPtr); |
︙ | |||
729 730 731 732 733 734 735 | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - - + - - - - - - - - - - - | Tcl_AppendElement( Tcl_Interp *interp, /* Interpreter whose result is to be * extended. */ const char *element) /* String to convert to list element and add * to result. */ { Interp *iPtr = (Interp *) interp; |
︙ | |||
940 941 942 943 944 945 946 | 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | - - - - - - - - - - - - | void Tcl_ResetResult( register Tcl_Interp *interp)/* Interpreter for which to clear result. */ { register Interp *iPtr = (Interp *) interp; ResetObjResult(iPtr); |
︙ |
Changes to generic/tclStubLib.c.
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - + + | /* * We can't optimize this check by caching tclStubsPtr because that * prevents apps from being able to load/unload Tcl dynamically multiple * times. [Bug 615304] */ if (!stubsPtr || (stubsPtr->magic != (((exact&0xff00) >= 0x900) ? magic : TCL_STUB_MAGIC))) { |
︙ |
Changes to generic/tclTest.c.
︙ | |||
5183 5184 5185 5186 5187 5188 5189 | 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 | - | static int TestsaveresultCmd( ClientData dummy, /* Not used. */ register Tcl_Interp *interp,/* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { |
︙ | |||
5251 5252 5253 5254 5255 5256 5257 | 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 | - + - - - + - | Tcl_DiscardResult(&state); } else { Tcl_RestoreResult(interp, &state); result = TCL_OK; } switch ((enum options) index) { |
︙ |
Changes to generic/tclUtil.c.
︙ | |||
2919 2920 2921 2922 2923 2924 2925 | 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 | - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | void Tcl_DStringGetResult( Tcl_Interp *interp, /* Interpreter whose result is to be reset. */ Tcl_DString *dsPtr) /* Dynamic string that is to become the result * of interp. */ { |
︙ |
Changes to tests/result.test.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + - + | testsaveresult small {set x 42} 0 } {small result} test result-1.2 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult append {set x 42} 0 } {append result} test result-1.3 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult dynamic {set x 42} 0 |
︙ |