diff options
author | sebres <sebres@users.sourceforge.net> | 2017-05-09 22:24:44 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-05-09 22:24:44 (GMT) |
commit | 87313fd6795a5c95c6788ed3b8d3443bdf3740a2 (patch) | |
tree | 4ec5ee600fd1546c7bedb39e0b2cb823f608a6ca | |
parent | 0283b4f5f3320e17a8ec17c3ec2aa6c07b9a8911 (diff) | |
download | tcl-87313fd6795a5c95c6788ed3b8d3443bdf3740a2.zip tcl-87313fd6795a5c95c6788ed3b8d3443bdf3740a2.tar.gz tcl-87313fd6795a5c95c6788ed3b8d3443bdf3740a2.tar.bz2 |
add missing compile functionality (TclPreserveByteCode/TclReleaseByteCode back-ported as inline from trunk)
-rw-r--r-- | generic/tclCompile.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index c04fc0e..90edf07 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1159,6 +1159,25 @@ MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp, Tcl_Token *varTokenPtr, CompileEnv *envPtr, int flags, int *localIndexPtr, int *isScalarPtr); + +static inline void +TclPreserveByteCode( + register ByteCode *codePtr) +{ + codePtr->refCount++; +} + +static inline void +TclReleaseByteCode( + register ByteCode *codePtr) +{ + if (codePtr->refCount-- > 1) { + return; + } + /* Just dropped to refcount==0. Clean up. */ + TclCleanupByteCode(codePtr); +} + MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr); MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp, const char *name, Namespace *nsPtr); |