From 87313fd6795a5c95c6788ed3b8d3443bdf3740a2 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 9 May 2017 22:24:44 +0000 Subject: add missing compile functionality (TclPreserveByteCode/TclReleaseByteCode back-ported as inline from trunk) --- generic/tclCompile.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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); -- cgit v0.12