Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch sebres-memopt-perf-branch Excluding Merge-Ins
This is equivalent to a diff from 783c4c0d18 to 348d9767d3
2019-10-02
| ||
17:53 | (Re-)implement a public set of routines for allocation and interest management of memory blocks shared by independent modules. These routines do not suffer the performance scaling failures of their Tcl counterparts, which is important to Itcl's usage patterns. Bump the version number to account for new public routines. Thanks to sebres for the contribution. check-in: 3559fa204b user: dgp tags: trunk | |
17:46 | Bump to version Itcl 4.2.0 to account for additions to set of public routines. Closed-Leaf check-in: 348d9767d3 user: dgp tags: sebres-memopt-perf-branch | |
17:38 | Document new (and old!) public routines. check-in: a03aaa0379 user: dgp tags: sebres-memopt-perf-branch | |
2019-09-20
| ||
16:34 | merge trunk check-in: db7140f46e user: dgp tags: sebres-memopt-perf-branch | |
2019-09-19
| ||
13:54 | Don't bother compiling with /DUNICODE /D_UNICODE, since Itcl doesn't use any Unicode Win32 API check-in: 783c4c0d18 user: jan.nijtmans tags: trunk | |
2019-09-18
| ||
12:46 | Use [::tcl::pkgconfig get debug] to check for debug mode, this is the only way that can be thrusted on all platforms. Update rules.vc to latest version check-in: 5e920169a8 user: jan.nijtmans tags: trunk | |
Changes to configure.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | #! /bin/sh # Guess values for system-dependent variables and create Makefiles. |
︙ | |||
573 574 575 576 577 578 579 | 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - - + + | subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='itcl' PACKAGE_TARNAME='itcl' |
︙ | |||
1301 1302 1303 1304 1305 1306 1307 | 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 | - + | # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF |
︙ | |||
1362 1363 1364 1365 1366 1367 1368 | 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 | - + | cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in |
︙ | |||
1462 1463 1464 1465 1466 1467 1468 | 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 | - + | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF |
︙ | |||
1794 1795 1796 1797 1798 1799 1800 | 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 | - + | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. |
︙ | |||
8826 8827 8828 8829 8830 8831 8832 | 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 | - + | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" |
︙ | |||
8879 8880 8881 8882 8883 8884 8885 | 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 | - + | Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ |
︙ |
Changes to configure.ac.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + | # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. # This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME> # so that we create the export library with the dll. #----------------------------------------------------------------------- |
︙ |
Changes to doc/Preserve.3.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + + + + - + - + - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | '\" '\" Copyright (c) 1993-1998 Lucent Technologies, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH Itcl_PreserveData 3 3.0 itcl "[incr\ Tcl] Library Procedures" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME |
Changes to generic/itcl.decls.
︙ | |||
85 86 87 88 89 90 91 92 93 94 95 96 97 98 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + | } declare 24 { int Itcl_RestoreInterpState(Tcl_Interp *interp, Itcl_InterpState state) } declare 25 { void Itcl_DiscardInterpState(Itcl_InterpState state) } declare 26 { void * Itcl_Alloc(size_t size) } declare 27 { void Itcl_Free(void *ptr) } # private API interface itclInt # # Functions used within the package, but not considered "public" # |
︙ |
Changes to generic/itcl.h.
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - + - + - - + + | # define TCL_BETA_RELEASE 1 #endif #ifndef TCL_FINAL_RELEASE # define TCL_FINAL_RELEASE 2 #endif #define ITCL_MAJOR_VERSION 4 |
︙ |
Changes to generic/itclBase.c.
︙ | |||
190 191 192 193 194 195 196 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - + - + - + - | clazzObjectPtr = Tcl_GetObjectFromObj(interp, objPtr); if (!clazzObjectPtr || !(tclCls = Tcl_GetObjectAsClass(clazzObjectPtr))) { Tcl_DecrRefCount(objPtr); return TCL_ERROR; } Tcl_DecrRefCount(objPtr); |
︙ |
Changes to generic/itclClass.c.
︙ | |||
289 290 291 292 293 294 295 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | - + | Tcl_InitHashTable(&iclsPtr->resolveVars, TCL_ONE_WORD_KEYS); Tcl_InitHashTable(&iclsPtr->contextCache, TCL_ONE_WORD_KEYS); Itcl_InitList(&iclsPtr->bases); Itcl_InitList(&iclsPtr->derived); resolveInfoPtr = (ItclResolveInfo *) ckalloc(sizeof(ItclResolveInfo)); |
︙ | |||
900 901 902 903 904 905 906 | 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | - + - + | */ hPtr = Tcl_FirstHashEntry(&iclsPtr->infoPtr->objects, &place); while (hPtr) { ioPtr = (ItclObject*)Tcl_GetHashValue(hPtr); if (ioPtr->iclsPtr == iclsPtr) { if ((ioPtr->accessCmd != NULL) && (!(ioPtr->flags & (ITCL_OBJECT_IS_DESTRUCTED)))) { |
︙ | |||
1074 1075 1076 1077 1078 1079 1080 | 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 | - + | Tcl_DeleteHashTable(&iclsPtr->options); /* * Delete all function definitions. */ FOREACH_HASH_VALUE(imPtr, &iclsPtr->functions) { imPtr->iclsPtr = NULL; |
︙ | |||
1209 1210 1211 1212 1213 1214 1215 | 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 | - + | Tcl_DecrRefCount(iclsPtr->namePtr); Tcl_DecrRefCount(iclsPtr->fullNamePtr); if (iclsPtr->resolvePtr != NULL) { ckfree((char *)iclsPtr->resolvePtr->clientData); ckfree((char *)iclsPtr->resolvePtr); } |
︙ | |||
1954 1955 1956 1957 1958 1959 1960 | 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 | - + - - + | */ if (config) { if (Itcl_CreateMemberCode(interp, iclsPtr, NULL, config, &mCodePtr) != TCL_OK) { Tcl_DeleteHashEntry(hPtr); return TCL_ERROR; } |
︙ | |||
2325 2326 2327 2328 2329 2330 2331 | 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 | - + - + | hPtr = Tcl_FindHashEntry(&ivPtr->iclsPtr->variables, (char *)ivPtr->namePtr); if (hPtr != NULL) { Tcl_DeleteHashEntry(hPtr); } } if (ivPtr->codePtr != NULL) { |
︙ | |||
2363 2364 2365 2366 2367 2368 2369 | 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 | - + | Tcl_DecrRefCount(ioptPtr->resourceNamePtr); } if (ioptPtr->resourceNamePtr != NULL) { Tcl_DecrRefCount(ioptPtr->classNamePtr); } if (ioptPtr->codePtr) { |
︙ | |||
2387 2388 2389 2390 2391 2392 2393 | 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 | - + | if (ioptPtr->validateMethodPtr != NULL) { Tcl_DecrRefCount(ioptPtr->validateMethodPtr); } if (ioptPtr->validateMethodVarPtr != NULL) { Tcl_DecrRefCount(ioptPtr->validateMethodVarPtr); } Itcl_ReleaseData(ioptPtr->idoPtr); |
︙ | |||
2418 2419 2420 2421 2422 2423 2424 | 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 | - + | hPtr = Tcl_FindHashEntry(&imPtr->iclsPtr->functions, (char *)imPtr->namePtr); if (hPtr != NULL) { Tcl_DeleteHashEntry(hPtr); } } if (imPtr->codePtr != NULL) { |
︙ | |||
2440 2441 2442 2443 2444 2445 2446 | 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 | - + | } if (imPtr->bodyPtr != NULL) { Tcl_DecrRefCount(imPtr->bodyPtr); } if (imPtr->argListPtr != NULL) { ItclDeleteArgList(imPtr->argListPtr); } |
︙ | |||
2501 2502 2503 2504 2505 2506 2507 | 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 | - + | } FOREACH_HASH_VALUE(objPtr, &idoPtr->exceptions) { if (objPtr != NULL) { Tcl_DecrRefCount(objPtr); } } Tcl_DeleteHashTable(&idoPtr->exceptions); |
︙ |
Changes to generic/itclDecls.h.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + | #endif /* !BEGIN!: Do not edit below this line. */ #define ITCL_STUBS_EPOCH 0 |
︙ | |||
88 89 90 91 92 93 94 95 96 97 98 99 100 101 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | + + + + | /* 23 */ ITCLAPI Itcl_InterpState Itcl_SaveInterpState(Tcl_Interp *interp, int status); /* 24 */ ITCLAPI int Itcl_RestoreInterpState(Tcl_Interp *interp, Itcl_InterpState state); /* 25 */ ITCLAPI void Itcl_DiscardInterpState(Itcl_InterpState state); /* 26 */ ITCLAPI void * Itcl_Alloc(size_t size); /* 27 */ ITCLAPI void Itcl_Free(void *ptr); typedef struct { const struct ItclIntStubs *itclIntStubs; } ItclStubHooks; typedef struct ItclStubs { int magic; |
︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + | void (*itcl_SetListValue) (Itcl_ListElem *elemPtr, ClientData val); /* 19 */ void (*itcl_EventuallyFree) (ClientData cdata, Tcl_FreeProc *fproc); /* 20 */ void (*itcl_PreserveData) (ClientData cdata); /* 21 */ void (*itcl_ReleaseData) (ClientData cdata); /* 22 */ Itcl_InterpState (*itcl_SaveInterpState) (Tcl_Interp *interp, int status); /* 23 */ int (*itcl_RestoreInterpState) (Tcl_Interp *interp, Itcl_InterpState state); /* 24 */ void (*itcl_DiscardInterpState) (Itcl_InterpState state); /* 25 */ void * (*itcl_Alloc) (size_t size); /* 26 */ void (*itcl_Free) (void *ptr); /* 27 */ } ItclStubs; extern const ItclStubs *itclStubsPtr; #ifdef __cplusplus } #endif |
︙ | |||
189 190 191 192 193 194 195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | + + + + | (itclStubsPtr->itcl_ReleaseData) /* 22 */ #define Itcl_SaveInterpState \ (itclStubsPtr->itcl_SaveInterpState) /* 23 */ #define Itcl_RestoreInterpState \ (itclStubsPtr->itcl_RestoreInterpState) /* 24 */ #define Itcl_DiscardInterpState \ (itclStubsPtr->itcl_DiscardInterpState) /* 25 */ #define Itcl_Alloc \ (itclStubsPtr->itcl_Alloc) /* 26 */ #define Itcl_Free \ (itclStubsPtr->itcl_Free) /* 27 */ #endif /* defined(USE_ITCL_STUBS) */ /* !END!: Do not edit above this line. */ #endif /* _ITCLDECLS */ |
Changes to generic/itclInt.h.
︙ | |||
370 371 372 373 374 375 376 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | - | Tcl_Obj *hullWindowNamePtr; /* the window path name for the hull * (before renaming in installhull) */ int destructorHasBeenCalled; /* is set when the destructor is called * to avoid callin destructor twice */ int noComponentTrace; /* don't call component traces if * setting components in DelegationInstall */ int hadConstructorError; /* needed for multiple calls of CallItclObjectCmd */ |
︙ | |||
400 401 402 403 404 405 406 | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | - | Tcl_Obj *bodyPtr; /* the function body */ ItclArgList *argListPtr; /* the parsed arguments */ union { Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */ Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */ } cfunc; ClientData clientData; /* client data for C implementations */ |
︙ | |||
502 503 504 505 506 507 508 | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | - | Tcl_Obj *origArgsPtr; /* the argument string of the original definition */ Tcl_Obj *bodyPtr; /* the function body */ ItclArgList *argListPtr; /* the parsed arguments */ ItclClass *declaringClassPtr; /* the class which declared the method/proc */ ClientData tmPtr; /* TclOO methodPtr */ ItclDelegatedFunction *idmPtr; /* if the function is delegated != NULL */ |
︙ | |||
659 660 661 662 663 664 665 | 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | - - - - - - - - - | #endif MODULE_SCOPE Tcl_ObjCmdProc ItclCallCCommand; MODULE_SCOPE Tcl_ObjCmdProc ItclObjectUnknownCommand; MODULE_SCOPE int ItclCheckCallProc(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished); |
︙ |
Changes to generic/itclIntDecls.h.
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - + | /* * This file is (mostly) automatically generated from itcl.decls. */ #ifndef _ITCLINTDECLS #define _ITCLINTDECLS /* !BEGIN!: Do not edit below this line. */ #define ITCLINT_STUBS_EPOCH 0 |
︙ |
Changes to generic/itclMethod.c.
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - | ItclArgList *realArgs); static int ItclCreateMemberCode(Tcl_Interp* interp, ItclClass *iclsPtr, const char* arglist, const char* body, ItclMemberCode** mcodePtr, Tcl_Obj *namePtr, int flags); static int ItclCreateMemberFunc(Tcl_Interp* interp, ItclClass *iclsPtr, Tcl_Obj *namePtr, const char* arglist, const char* body, ItclMemberFunc** imPtrPtr, int flags); |
︙ | |||
306 307 308 309 310 311 312 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | - + - + | if (Itcl_CreateMemberCode(interp, iclsPtr, NULL, token, &mcode) != TCL_OK) { status = TCL_ERROR; goto configBodyCmdDone; } |
︙ | |||
513 514 515 516 517 518 519 | 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | - - + + - + | Tcl_DeleteHashEntry(hPtr); return TCL_ERROR; } /* * Allocate a member function definition and return. */ |
︙ | |||
673 674 675 676 677 678 679 | 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | - + | imPtr->flags |= ITCL_CONSTRUCTOR; } if (strcmp(name, "destructor") == 0) { imPtr->flags |= ITCL_DESTRUCTOR; } Tcl_SetHashValue(hPtr, imPtr); |
︙ | |||
763 764 765 766 767 768 769 | 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | + - + | } Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "argument list changed for function \"", Tcl_GetString(imPtr->fullNamePtr), "\": should be \"", argsStr, "\"", NULL); Itcl_PreserveData(mcode); |
︙ | |||
789 790 791 792 793 794 795 | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | - - + + | mcode->bodyPtr = newBody; Tcl_IncrRefCount(mcode->bodyPtr); } /* * Free up the old implementation and install the new one. */ |
︙ | |||
856 857 858 859 860 861 862 | 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 | - - + + + - + | ItclMemberCode *mcode; const char **cPtrPtr; int haveError; /* * Allocate some space to hold the implementation. */ |
︙ | |||
905 906 907 908 909 910 911 | 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 | + - + | startStr = ""; } Tcl_AppendResult(interp, startStr, namePtr == NULL ? "??" : Tcl_GetString(namePtr), "'s arglist may not contain \"", *cPtrPtr, "\" explicitly", NULL); Itcl_PreserveData(mcode); |
︙ | |||
1022 1023 1024 1025 1026 1027 1028 | 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 | + - + | } if (!isDone) { if (!Itcl_FindC(interp, body+1, &argCmdProc, &objCmdProc, &cdata)) { Tcl_AppendResult(interp, "no registered C procedure with name \"", body+1, "\"", NULL); Itcl_PreserveData(mcode); |
︙ | |||
1076 1077 1078 1079 1080 1081 1082 | 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | - + | * * Creates the data record representing the implementation behind a * class member function. This includes the argument list and the body * of the function. If the body is of the form "@name", then it is * treated as a label for a C procedure registered by Itcl_RegisterC(). * * A member function definition holds a handle for the implementation, and |
︙ | |||
1105 1106 1107 1108 1109 1110 1111 | 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 | - + - + - + | * Itcl_DeleteMemberCode() * * Destroys all data associated with the given command implementation. * Invoked automatically by ItclReleaseData() when the implementation * is no longer being used. * ------------------------------------------------------------------------ */ |
︙ | |||
1286 1287 1288 1289 1290 1291 1292 | 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 | - + | } mcode = imPtr->codePtr; /* * Bump the reference count on this code, in case it is * redefined or deleted during execution. */ |
︙ | |||
1324 1325 1326 1327 1328 1329 1330 | 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 | - + | callbackPtr = Itcl_GetCurrentCallbackPtr(interp); Tcl_NRAddCallback(interp, CallItclObjectCmd, imPtr, contextIoPtr, INT2PTR(objc), (void *)objv); result = Itcl_NRRunCallbacks(interp, callbackPtr); } } |
︙ | |||
1725 1726 1727 1728 1729 1730 1731 | 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 | - + - + | } } /* * Execute the code for the method. Be careful to protect * the method in case it gets deleted during execution. */ |
︙ | |||
1811 1812 1813 1814 1815 1816 1817 | 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 | - + - + | } } /* * Execute the code for the proc. Be careful to protect * the proc in case it gets deleted during execution. */ |
︙ | |||
2008 2009 2010 2011 2012 2013 2014 | 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 | - + - + | &cmdlinec, &cmdlinev); ItclShowArgs(1, "EMC", cmdlinec, cmdlinev); /* * Execute the code for the method. Be careful to protect * the method in case it gets deleted during execution. */ |
︙ | |||
2346 2347 2348 2349 2350 2351 2352 | 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 | - + | int min_allowed_args; ItclObjectInfo *infoPtr; oPtr = NULL; hPtr = NULL; imPtr = (ItclMemberFunc *)clientData; |
︙ | |||
2483 2484 2485 2486 2487 2488 2489 | 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 | - + - + | stackPtr = (Itcl_Stack *)Tcl_GetHashValue(hPtr); } Itcl_PushStack(framePtr, stackPtr); if (ioPtr != NULL) { ioPtr->callRefCount++; |
︙ | |||
2597 2598 2599 2600 2601 2602 2603 | 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 | - + - + | if (callContextPtr->refCount-- <= 1) { if (callContextPtr->ioPtr != NULL) { hPtr = Tcl_FindHashEntry(&callContextPtr->ioPtr->contextCache, (char *)callContextPtr->imPtr); if (hPtr == NULL) { ckfree((char *)callContextPtr); } |
︙ |
Changes to generic/itclObject.c.
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + - - - - - - - - - - - - - - - - - - | const char *name1, const char *name2, int flags); static char* ItclTraceComponentVar(ClientData cdata, Tcl_Interp *interp, const char *name1, const char *name2, int flags); static char* ItclTraceItclHullVar(ClientData cdata, Tcl_Interp *interp, const char *name1, const char *name2, int flags); static void ItclDestroyObject(ClientData clientData); |
︙ | |||
261 262 263 264 265 266 267 | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | - - + + - + - + | if (infoPtr != NULL) { infoPtr->lastIoPtr = NULL; } /* * Create a new object and initialize it. */ |
︙ | |||
313 314 315 316 317 318 319 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | - + | Tcl_InitObjHashTable(&ioPtr->objectOptions); Tcl_InitObjHashTable(&ioPtr->objectComponents); Tcl_InitObjHashTable(&ioPtr->objectDelegatedOptions); Tcl_InitObjHashTable(&ioPtr->objectDelegatedFunctions); Tcl_InitObjHashTable(&ioPtr->objectMethodVariables); Tcl_InitHashTable(&ioPtr->contextCache, TCL_ONE_WORD_KEYS); |
︙ | |||
508 509 510 511 512 513 514 | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | - + | if (ioPtr->accessCmd != (Tcl_Command) NULL) { Tcl_DeleteCommandFromToken(interp, ioPtr->accessCmd); ioPtr->accessCmd = NULL; } result = Itcl_RestoreInterpState(interp, istate); infoPtr->currIoPtr = saveCurrIoPtr; /* need this for 2 ReleaseData at errorReturn!! */ |
︙ | |||
557 558 559 560 561 562 563 | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | - + | */ if (ioPtr->accessCmd != (Tcl_Command) NULL) { Tcl_DeleteCommandFromToken(interp, ioPtr->accessCmd); ioPtr->accessCmd = NULL; } result = Itcl_RestoreInterpState(interp, istate); /* need this for 2 ReleaseData at errorReturn!! */ |
︙ | |||
609 610 611 612 613 614 615 | 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | - + | istate = Itcl_SaveInterpState(interp, result); if (ioPtr->accessCmd != (Tcl_Command) NULL) { Tcl_DeleteCommandFromToken(interp, ioPtr->accessCmd); ioPtr->accessCmd = NULL; } result = Itcl_RestoreInterpState(interp, istate); /* need this for 2 ReleaseData at errorReturn!! */ |
︙ | |||
701 702 703 704 705 706 707 | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | - + | infoPtr->currIoPtr = saveCurrIoPtr; } infoPtr->lastIoPtr = ioPtr; Tcl_DeleteHashTable(ioPtr->constructed); ckfree((char*)ioPtr->constructed); ioPtr->constructed = NULL; ItclAddObjectsDictInfo(interp, ioPtr); |
︙ | |||
726 727 728 729 730 731 732 | 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 | - - + + | } if (ioPtr->constructed != NULL) { Tcl_DeleteHashTable(ioPtr->constructed); ckfree((char*)ioPtr->constructed); ioPtr->constructed = NULL; } ItclDeleteObjectVariablesNamespace(interp, ioPtr); |
︙ | |||
1221 1222 1223 1224 1225 1226 1227 | 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 | - + - + | Tcl_CmdInfo cmdInfo; Tcl_HashEntry *hPtr; Tcl_GetCommandInfoFromToken(contextIoPtr->accessCmd, &cmdInfo); contextIoPtr->flags |= ITCL_OBJECT_IS_DELETED; |
︙ | |||
1251 1252 1253 1254 1255 1256 1257 | 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 | - + - + | * safely deleted without attempting to destruct the object * again. Then delete the access command. If this is * the last use of the object data, the object will die here. */ if ((contextIoPtr->accessCmd != NULL) && (!(contextIoPtr->flags & (ITCL_OBJECT_IS_RENAMED)))) { if (Tcl_GetCommandInfoFromToken(contextIoPtr->accessCmd, &cmdInfo) == 1) { |
︙ | |||
2633 2634 2635 2636 2637 2638 2639 | 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 | - + - + - + - - + | (char*)contextIoPtr); if (hPtr) { Tcl_DeleteHashEntry(hPtr); } contextIoPtr->accessCmd = NULL; } |
︙ | |||
2715 2716 2717 2718 2719 2720 2721 | 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 | - + | Tcl_DecrRefCount(ioPtr->hullWindowNamePtr); } Tcl_DecrRefCount(ioPtr->varNsNamePtr); if (ioPtr->resolvePtr != NULL) { ckfree((char *)ioPtr->resolvePtr->clientData); ckfree((char*)ioPtr->resolvePtr); } |
︙ |
Changes to generic/itclParse.c.
︙ | |||
635 636 637 638 639 640 641 | 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | - + - + - + | static Tcl_MethodCallProc ArgCallProc; static Tcl_CloneProc CloneProc; static const Tcl_MethodType itclObjMethodType = { TCL_OO_METHOD_VERSION_CURRENT, "itcl objv method", ObjCallProc, |
︙ | |||
877 878 879 880 881 882 883 | 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 | - + - + - + | bodyPtr = imPtr->codePtr->bodyPtr; if (imPtr->codePtr->flags & ITCL_IMPLEMENT_OBJCMD) { /* Implementation of this member is coded in C expecting Tcl_Obj */ imPtr->tmPtr = Tcl_NewMethod(interp, iclsPtr->clsPtr, imPtr->namePtr, 1, &itclObjMethodType, imPtr); |
︙ | |||
1084 1085 1086 1087 1088 1089 1090 | 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 | - - + + - - + + | ItclProcErrorProc, imPtr, imPtr->namePtr, argumentPtr, bodyPtr, &pmPtr); } } if ((imPtr->flags & ITCL_COMMON) == 0) { imPtr->accessCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(imPtr->fullNamePtr), |
︙ | |||
2414 2415 2416 2417 2418 2419 2420 | 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 | - + | hPtr = Tcl_FirstHashEntry(&infoPtr->objects, &place); /*hPtr = Tcl_NextHashEntry(&place);*/ } Tcl_DeleteHashTable(&infoPtr->objects); Tcl_DeleteHashTable(&infoPtr->frameContext); Itcl_DeleteStack(&infoPtr->clsStack); |
︙ | |||
2827 2828 2829 2830 2831 2832 2833 | 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 | - + - | } classNamePtr = ItclCapitalize(className); init = defaultValue; if ((newObjc > 1) && (init == NULL)) { init = Tcl_GetString(newObjv[1]); } |
︙ | |||
3768 3769 3770 3771 3772 3773 3774 | 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 | - - + | if (hPtr != NULL) { Tcl_AppendResult(interp, "option \"", option, "\" has been defined locally", NULL); goto errorOut1; return TCL_ERROR; } } |
︙ | |||
3820 3821 3822 3823 3824 3825 3826 | 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 | - + | if (idoPtrPtr != NULL) { *idoPtrPtr = idoPtr; } ckfree((char *)argv); ItclAddDelegatedOptionDictInfo(interp, iclsPtr, idoPtr); return TCL_OK; errorOut2: |
︙ |
Changes to generic/itclStubInit.c.
︙ | |||
231 232 233 234 235 236 237 238 239 240 | 231 232 233 234 235 236 237 238 239 240 241 242 | + + | Itcl_SetListValue, /* 19 */ Itcl_EventuallyFree, /* 20 */ Itcl_PreserveData, /* 21 */ Itcl_ReleaseData, /* 22 */ Itcl_SaveInterpState, /* 23 */ Itcl_RestoreInterpState, /* 24 */ Itcl_DiscardInterpState, /* 25 */ Itcl_Alloc, /* 26 */ Itcl_Free, /* 27 */ }; /* !END!: Do not edit above this line. */ |
Changes to generic/itclUtil.c.
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + | * ======================================================================== * Copyright (c) 1993-1998 Lucent Technologies, Inc. * ------------------------------------------------------------------------ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "itclInt.h" #include <limits.h> /* * POOL OF LIST ELEMENTS FOR LINKED LIST */ static Itcl_ListElem *listPool = NULL; static int listPoolLen = 0; |
︙ | |||
483 484 485 486 487 488 489 | 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | - - - + | * ------------------------------------------------------------------------ */ void Itcl_SetListValue( Itcl_ListElem *elemPtr, /* list element being modified */ ClientData val) /* new value associated with element */ { |
︙ | |||
522 523 524 525 526 527 528 | 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 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 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 | - - - - - - + + + + + + + + + + + + - + - - - - + + - - + + - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /* * ======================================================================== * REFERENCE-COUNTED DATA * * The following procedures manage generic reference-counted data. * They are similar in spirit to the Tcl_Preserve/Tcl_Release |
︙ |