Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Revise empty string tests so that we avoid potentially expensive string rep generations, especially for dicts. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-5-branch |
Files: | files | file ages | folders |
SHA1: |
765f5fcb202a25c4d1f944d0f5e7e80e |
User & Date: | dgp 2011-05-09 13:53:09 |
Context
2011-05-10
| ||
16:52 | New internal routines TclScanElement() and TclConvertElement(). Rewritten guts of machinery to produ... check-in: 37927cede6 user: dgp tags: core-8-5-branch | |
2011-05-09
| ||
13:58 | Revise empty string tests so that we avoid potentially expensive string rep generations, especially ... check-in: c2d4899eeb user: dgp tags: trunk | |
13:53 | Revise empty string tests so that we avoid potentially expensive string rep generations, especially ... check-in: 765f5fcb20 user: dgp tags: core-8-5-branch | |
13:46 | Remove the old implementation. Closed-Leaf check-in: a040b3dde3 user: dgp tags: dgp-list-simplify | |
2011-05-07
| ||
19:30 | fix USE_TCLALLOC so that it can be enabled without editing the Makefile check-in: a569696f48 user: mig tags: core-8-5-branch | |
Changes
Changes to ChangeLog.
1 2 3 4 5 6 7 | 2011-05-07 Miguel Sofer <[email protected]> * generic/tclInt.h: fix USE_TCLALLOC so that it can be enabled * unix/Makefile.in: without editing the Makefile 2011-05-05 Don Porter <[email protected]> | > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 | 2011-05-09 Don Porter <[email protected]> * generic/tclListObj.c: Revise empty string tests so that we avoid potentially expensive string rep generations, especially for dicts. 2011-05-07 Miguel Sofer <[email protected]> * generic/tclInt.h: fix USE_TCLALLOC so that it can be enabled * unix/Makefile.in: without editing the Makefile 2011-05-05 Don Porter <[email protected]> |
︙ | ︙ |
Changes to generic/tclListObj.c.
︙ | ︙ | |||
456 457 458 459 460 461 462 | * referenced by objv. */ Tcl_Obj ***objvPtr) /* Where to store the pointer to an array of * pointers to the list's objects. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { | | < < < < | < < < < < < < | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | * referenced by objv. */ Tcl_Obj ***objvPtr) /* Where to store the pointer to an array of * pointers to the list's objects. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result; if (listPtr->bytes == tclEmptyStringRep) { *objcPtr = 0; *objvPtr = NULL; return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { return result; } } listRepPtr = ListRepPtr(listPtr); *objcPtr = listRepPtr->elemCount; |
︙ | ︙ | |||
583 584 585 586 587 588 589 | register Tcl_Obj **elemPtrs; int numElems, numRequired, newMax, newSize, i; if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendElement"); } if (listPtr->typePtr != &tclListType) { | | | < < < < < < | 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | register Tcl_Obj **elemPtrs; int numElems, numRequired, newMax, newSize, i; if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendElement"); } if (listPtr->typePtr != &tclListType) { int result; if (listPtr->bytes == tclEmptyStringRep) { Tcl_SetListObj(listPtr, 1, &objPtr); return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { return result; } } listRepPtr = ListRepPtr(listPtr); |
︙ | ︙ | |||
698 699 700 701 702 703 704 | register Tcl_Obj *listPtr, /* List object to index into. */ register int index, /* Index of element to return. */ Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { | | | < < < < < < | 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | register Tcl_Obj *listPtr, /* List object to index into. */ register int index, /* Index of element to return. */ Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result; if (listPtr->bytes == tclEmptyStringRep) { *objPtrPtr = NULL; return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { return result; } } listRepPtr = ListRepPtr(listPtr); |
︙ | ︙ | |||
757 758 759 760 761 762 763 | Tcl_Interp *interp, /* Used to report errors if not NULL. */ register Tcl_Obj *listPtr, /* List object whose #elements to return. */ register int *intPtr) /* The resulting int is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { | | | < < < < < < < < < < < < < < < | 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 | Tcl_Interp *interp, /* Used to report errors if not NULL. */ register Tcl_Obj *listPtr, /* List object whose #elements to return. */ register int *intPtr) /* The resulting int is stored here. */ { register List *listRepPtr; if (listPtr->typePtr != &tclListType) { int result; if (listPtr->bytes == tclEmptyStringRep) { *intPtr = 0; return TCL_OK; } result = SetListFromAny(interp, listPtr); if (result != TCL_OK) { return result; } } listRepPtr = ListRepPtr(listPtr); |
︙ | ︙ | |||
845 846 847 848 849 850 851 | register Tcl_Obj **elemPtrs; int numElems, numRequired, numAfterLast, start, i, j, isShared; if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); } if (listPtr->typePtr != &tclListType) { | < | < < < < < < | 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | register Tcl_Obj **elemPtrs; int numElems, numRequired, numAfterLast, start, i, j, isShared; if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); } if (listPtr->typePtr != &tclListType) { if (listPtr->bytes == tclEmptyStringRep) { if (objc) { Tcl_SetListObj(listPtr, objc, NULL); } else { return TCL_OK; } } else { int result = SetListFromAny(interp, listPtr); |
︙ | ︙ | |||
1547 1548 1549 1550 1551 1552 1553 | * Ensure that the listPtr parameter designates an unshared list. */ if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "TclListObjSetElement"); } if (listPtr->typePtr != &tclListType) { | | | < < < < < | 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 | * Ensure that the listPtr parameter designates an unshared list. */ if (Tcl_IsShared(listPtr)) { Tcl_Panic("%s called with shared object", "TclListObjSetElement"); } if (listPtr->typePtr != &tclListType) { int result; if (listPtr->bytes == tclEmptyStringRep) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("list index out of range", -1)); } return TCL_ERROR; } result = SetListFromAny(interp, listPtr); |
︙ | ︙ |