summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-12-27 21:41:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-12-27 21:41:31 (GMT)
commit3408294224c7b4208ce601753a2180879b41e6ca (patch)
treecc71e1397a3d85fca94ad224345cae995c06ec01 /generic/tclObj.c
parent9694587a1a9ae9931bbef3181d46c69e75e42c8e (diff)
parent63224df965c165226da5226eba2d0036d0b6d2b3 (diff)
downloadtcl-3408294224c7b4208ce601753a2180879b41e6ca.zip
tcl-3408294224c7b4208ce601753a2180879b41e6ca.tar.gz
tcl-3408294224c7b4208ce601753a2180879b41e6ca.tar.bz2
Merge trunk.
Rename Tcl_MemAlloc and friends back to Tcl_Alloc, as this renaming turns out not to be necessary. Make everything compile/run with TCL_MEM_DEBUG=1 (a few signatures were still not correct)
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 39e779b..39242c5 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -1012,7 +1012,7 @@ TclDbDumpActiveObjects(
tablePtr = tsdPtr->objThreadMap;
if (tablePtr != NULL) {
- fprintf(outFile, "total objects: %d\n", tablePtr->numEntries);
+ fprintf(outFile, "total objects: %" TCL_LL_MODIFIER "d\n", (Tcl_WideInt)tablePtr->numEntries);
for (hPtr = Tcl_FirstHashEntry(tablePtr, &hSearch); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&hSearch)) {
ObjData *objData = Tcl_GetHashValue(hPtr);
@@ -1338,7 +1338,7 @@ TclFreeObj(
* either from 1 to 0, or from 0 to -1. Falling from -1 to -2, though,
* and so on, is always a sign of a botch in the caller.
*/
- if (objPtr->refCount < -1) {
+ if (objPtr->refCount == (size_t)-2) {
Tcl_Panic("Reference count for %p was negative", objPtr);
}
/*
@@ -1346,16 +1346,16 @@ TclFreeObj(
* sure we do not accept a second free when falling from 0 to -1.
* Skip that possibility so any double free will trigger the panic.
*/
- objPtr->refCount = -1;
+ objPtr->refCount = (size_t)-1;
/*
* Invalidate the string rep first so we can use the bytes value for our
* pointer chain, and signal an obj deletion (as opposed to shimmering)
- * with 'length == -1'.
+ * with 'length == (size_t)-1'.
*/
TclInvalidateStringRep(objPtr);
- objPtr->length = -1;
+ objPtr->length = (size_t)-1;
if (ObjDeletePending(context)) {
PushObjToDelete(context, objPtr);