diff options
author | dgp <dgp@users.sourceforge.net> | 2012-12-14 19:25:04 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-12-14 19:25:04 (GMT) |
commit | ad47aaa8d919090d79a2ce390b08653ef8e3fae8 (patch) | |
tree | 95baaaf86795c70b594ff3fa78b62dc588c4e242 /generic/tcl.h | |
parent | 55ceb591d7bd0c530c73961be1c05996e8cc5920 (diff) | |
parent | 4eaff43e124f523dca05591bc760fa9f32eb7672 (diff) | |
download | tcl-ad47aaa8d919090d79a2ce390b08653ef8e3fae8.zip tcl-ad47aaa8d919090d79a2ce390b08653ef8e3fae8.tar.gz tcl-ad47aaa8d919090d79a2ce390b08653ef8e3fae8.tar.bz2 |
merge trunk, update changes and re-tagcore_8_6_0core_8_6_0_rc
Diffstat (limited to 'generic/tcl.h')
-rw-r--r-- | generic/tcl.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 6a6ac9b..3003abf 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -854,10 +854,7 @@ typedef struct Tcl_Obj { * whether an object is shared (i.e. has reference count > 1). Note: clients * should use Tcl_DecrRefCount() when they are finished using an object, and * should never call TclFreeObj() directly. TclFreeObj() is only defined and - * made public in tcl.h to support Tcl_DecrRefCount's macro definition. Note - * also that Tcl_DecrRefCount() refers to the parameter "obj" twice. This - * means that you should avoid calling it with an expression that is expensive - * to compute or has side effects. + * made public in tcl.h to support Tcl_DecrRefCount's macro definition. */ void Tcl_IncrRefCount(Tcl_Obj *objPtr); @@ -2504,7 +2501,12 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); * http://c2.com/cgi/wiki?TrivialDoWhileLoop */ # define Tcl_DecrRefCount(objPtr) \ - do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0) + do { \ + Tcl_Obj *_objPtr = (objPtr); \ + if (--(_objPtr)->refCount <= 0) { \ + TclFreeObj(_objPtr); \ + } \ + } while(0) # define Tcl_IsShared(objPtr) \ ((objPtr)->refCount > 1) #endif |