Posted to tcl by schelte at Sun Jul 13 14:07:38 GMT 2025view raw
- #undef Tcl_IncrRefCount
- #define Tcl_IncrRefCount(objPtr) \
- printf("%d: Tcl_IncrRefCount(%p) == %d\n", __LINE__, objPtr, ++(objPtr)->refCount);
- #undef Tcl_DecrRefCount
- #define Tcl_DecrRefCount(objPtr) \
- do { \
- Tcl_Obj *_objPtr = (objPtr); \
- printf("%d: Tcl_DecrRefCount(%p) == %d\n", __LINE__, objPtr, --(_objPtr)->refCount); \
- if (_objPtr->refCount <= 0) { \
- TclFreeObj(_objPtr); \
- } \
- } while(0)
Add a comment