diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-04 07:59:10 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-04 07:59:10 (GMT) |
commit | 1674055d7a5077032b0ae8c68af6e7593420cdfd (patch) | |
tree | 5a2b26b3d8c8cca03a5e60c6b1b87979021cac38 /generic/tclInt.h | |
parent | a9843e57c2416046ee657b66dc7bd9e4fba46ff3 (diff) | |
parent | fd253d8677ffcef7052c8ac03cbd68c656835a35 (diff) | |
download | tcl-1674055d7a5077032b0ae8c68af6e7593420cdfd.zip tcl-1674055d7a5077032b0ae8c68af6e7593420cdfd.tar.gz tcl-1674055d7a5077032b0ae8c68af6e7593420cdfd.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 4632887..0eecfb3 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1691,18 +1691,18 @@ typedef struct Command { /* * Flag bits for commands. * - * CMD_IS_DELETED - Means that the command is in the process of + * CMD_DYING - If 1 the command is in the process of * being deleted (its deleteProc is currently * executing). Other attempts to delete the * command should be ignored. - * CMD_TRACE_ACTIVE - 1 means that trace processing is currently + * CMD_TRACE_ACTIVE - If 1 the trace processing is currently * underway for a rename/delete change. See the * two flags below for which is currently being * processed. - * CMD_HAS_EXEC_TRACES - 1 means that this command has at least one + * CMD_HAS_EXEC_TRACES - If 1 means that this command has at least one * execution trace (as opposed to simple * delete/rename traces) in its tracePtr list. - * CMD_COMPILES_EXPANDED - 1 means that this command has a compiler that + * CMD_COMPILES_EXPANDED - If 1 this command has a compiler that * can handle expansion (provided it is not the * first word). * TCL_TRACE_RENAME - A rename trace is in progress. Further @@ -1712,7 +1712,7 @@ typedef struct Command { * (these last two flags are defined in tcl.h) */ -#define CMD_IS_DELETED 0x01 +#define CMD_DYING 0x01 #define CMD_TRACE_ACTIVE 0x02 #define CMD_HAS_EXEC_TRACES 0x04 #define CMD_COMPILES_EXPANDED 0x08 @@ -4910,10 +4910,30 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; * the internal stubs, but the core can use the macro instead. */ -#define TclCleanupCommandMacro(cmdPtr) \ - if ((cmdPtr)->refCount-- <= 1) { \ - Tcl_Free(cmdPtr);\ - } +#define TclCleanupCommandMacro(cmdPtr) \ + do { \ + if ((cmdPtr)->refCount-- <= 1) { \ + Tcl_Free(cmdPtr); \ + } \ + } while (0) + + +/* + * inside this routine increment refCount first incase cmdPtr is replacing itself + */ +#define TclRoutineAssign(location, cmdPtr) \ + do { \ + (cmdPtr)->refCount++; \ + if ((location) != NULL \ + && (location--) <= 1) { \ + Tcl_Free(((location))); \ + } \ + (location) = (cmdPtr); \ + } while (0) + + +#define TclRoutineHasName(cmdPtr) \ + ((cmdPtr)->hPtr != NULL) /* *---------------------------------------------------------------- |