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 | 2752a9f58b6ee57703c3bc087133751e0192f150 (patch) | |
| tree | 4ec5ee600fd1546c7bedb39e0b2cb823f608a6ca | |
| parent | a73818d8b609eb10bd00e9df77bb594f9c01af43 (diff) | |
| download | tcl-2752a9f58b6ee57703c3bc087133751e0192f150.zip tcl-2752a9f58b6ee57703c3bc087133751e0192f150.tar.gz tcl-2752a9f58b6ee57703c3bc087133751e0192f150.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); |
