File tree Expand file tree Collapse file tree 3 files changed +30
-31
lines changed Expand file tree Collapse file tree 3 files changed +30
-31
lines changed Original file line number Diff line number Diff line change @@ -4295,6 +4295,36 @@ TclScaleTime(
42954295 } \
42964296 }
42974297
4298+ /*
4299+ * Primitives to safe set, reset and free references.
4300+ */
4301+
4302+ #define TclUnsetObjRef (obj ) \
4303+ do { \
4304+ if (obj != NULL) { \
4305+ Tcl_DecrRefCount(obj); \
4306+ obj = NULL; \
4307+ } \
4308+ } while (0)
4309+ #define TclInitObjRef (obj , val ) \
4310+ do { \
4311+ obj = (val); \
4312+ if (obj) { \
4313+ Tcl_IncrRefCount(obj); \
4314+ } \
4315+ } while (0)
4316+ #define TclSetObjRef (obj , val ) \
4317+ do { \
4318+ Tcl_Obj *nval = (val); \
4319+ if (obj != nval) { \
4320+ Tcl_Obj *prev = obj; \
4321+ TclInitObjRef(obj, nval); \
4322+ if (prev != NULL) { \
4323+ Tcl_DecrRefCount(prev); \
4324+ } \
4325+ } \
4326+ } while (0)
4327+
42984328#if TCL_THREADS && !defined(USE_THREAD_ALLOC )
42994329# define USE_THREAD_ALLOC 1
43004330#endif
Original file line number Diff line number Diff line change 1111
1212#include "tclInt.h"
1313#include <assert.h>
14- #include "tclStrIdxTree.h"
1514
1615/*
1716 * Indices of the standard return options dictionary keys.
Original file line number Diff line number Diff line change @@ -138,36 +138,6 @@ TclUtfFindEqualNCInLwr(
138138 } while ((ret = cs ) < cse && cin < cine );
139139 return ret ;
140140}
141-
142- /*
143- * Primitives to safe set, reset and free references.
144- */
145-
146- #define TclUnsetObjRef (obj ) \
147- do { \
148- if (obj != NULL) { \
149- Tcl_DecrRefCount(obj); \
150- obj = NULL; \
151- } \
152- } while (0)
153- #define TclInitObjRef (obj , val ) \
154- do { \
155- obj = (val); \
156- if (obj) { \
157- Tcl_IncrRefCount(obj); \
158- } \
159- } while (0)
160- #define TclSetObjRef (obj , val ) \
161- do { \
162- Tcl_Obj *nval = (val); \
163- if (obj != nval) { \
164- Tcl_Obj *prev = obj; \
165- TclInitObjRef(obj, nval); \
166- if (prev != NULL) { \
167- Tcl_DecrRefCount(prev); \
168- } \
169- } \
170- } while (0)
171141
172142/*
173143 * Prototypes of module functions.
You can’t perform that action at this time.
0 commit comments