Tcl Source Code

Check-in [59b85594f2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:two more places where refCount was assumed to be a signed value. In Tcl9 that will probably be not true any more.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | novem
Files: files | file ages | folders
SHA1: 59b85594f2fef40223eae1e44ff0c15e7303e248
User & Date: jan.nijtmans 2012-12-29 18:12:45
Context
2013-01-02
14:56
merge trunk check-in: ab2fe69baf user: jan.nijtmans tags: novem
11:58
merge trunk. tclStubLib.c: protect loading incompatible Tcl9 extensions in Tcl8 check-in: 4919da4fc4 user: jan.nijtmans tags: novem-more-memory-API
2012-12-29
18:17
Fix correct cleanup in more situations, using a new macro TclFreeIfRefCountZero Closed-Leaf check-in: 00a7908896 user: jan.nijtmans tags: novem-freeifrefcountzero
18:12
two more places where refCount was assumed to be a signed value. In Tcl9 that will probably be not t... check-in: 59b85594f2 user: jan.nijtmans tags: novem
15:24
fix tm.tcl to include tcl8 locations, and fix corresponding test-cases check-in: c2a6bd5d9e user: jan.nijtmans tags: novem
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclObj.c.

3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
                    "decr ref count");
	}

	/*
	 * If the Tcl_Obj is going to be deleted, remove the entry.
	 */

	if ((objPtr->refCount - 1) <= 0) {
	    ObjData *objData = Tcl_GetHashValue(hPtr);

	    if (objData != NULL) {
		ckfree(objData);
	    }

	    Tcl_DeleteHashEntry(hPtr);
	}
    }
# endif /* TCL_THREADS */
#endif /* TCL_MEM_DEBUG */

    if (--(objPtr)->refCount <= 0) {
	TclFreeObj(objPtr);
    }
}

/*
 *----------------------------------------------------------------------
 *







|












|







3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
                    "decr ref count");
	}

	/*
	 * If the Tcl_Obj is going to be deleted, remove the entry.
	 */

	if (objPtr->refCount < 2) {
	    ObjData *objData = Tcl_GetHashValue(hPtr);

	    if (objData != NULL) {
		ckfree(objData);
	    }

	    Tcl_DeleteHashEntry(hPtr);
	}
    }
# endif /* TCL_THREADS */
#endif /* TCL_MEM_DEBUG */

    if ((objPtr)->refCount-- < 2) {
	TclFreeObj(objPtr);
    }
}

/*
 *----------------------------------------------------------------------
 *