summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-09-01 22:01:35 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-09-01 22:01:35 (GMT)
commitba417d3ce6d273a724c772efed9f3fbca65b94a8 (patch)
tree954bdbecb4cb9c3a063b6ad4b237f6c7a7c05ae1 /generic/tclDictObj.c
parente663097026638d349d2ac63a28f5c5fcd6f15677 (diff)
parent195f90c9510d639c9807253136edfce377cbeef9 (diff)
downloadtcl-ba417d3ce6d273a724c772efed9f3fbca65b94a8.zip
tcl-ba417d3ce6d273a724c772efed9f3fbca65b94a8.tar.gz
tcl-ba417d3ce6d273a724c772efed9f3fbca65b94a8.tar.bz2
Change ckalloc and friends to Tcl_Alloc and friends. Add two defines, TCL_IO_FAILURE and TCL_NO_LENGTH (experimental, still open to be renamed following discussion)
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 5435a80..119b7a0 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -232,7 +232,7 @@ AllocChainEntry(
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
ChainEntry *cPtr;
- cPtr = ckalloc(sizeof(ChainEntry));
+ cPtr = Tcl_Alloc(sizeof(ChainEntry));
cPtr->entry.key.objPtr = objPtr;
Tcl_IncrRefCount(objPtr);
Tcl_SetHashValue(&cPtr->entry, NULL);
@@ -364,7 +364,7 @@ DupDictInternalRep(
Tcl_Obj *copyPtr)
{
Dict *oldDict = DICT(srcPtr);
- Dict *newDict = ckalloc(sizeof(Dict));
+ Dict *newDict = Tcl_Alloc(sizeof(Dict));
ChainEntry *cPtr;
/*
@@ -458,7 +458,7 @@ DeleteDict(
Dict *dict)
{
DeleteChainTable(dict);
- ckfree(dict);
+ Tcl_Free(dict);
}
/*
@@ -517,7 +517,7 @@ UpdateStringOfDict(
if (numElems <= LOCAL_SIZE) {
flagPtr = localFlags;
} else {
- flagPtr = ckalloc(numElems);
+ flagPtr = Tcl_Alloc(numElems);
}
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
/*
@@ -543,7 +543,7 @@ UpdateStringOfDict(
*/
dictPtr->length = bytesNeeded - 1;
- dictPtr->bytes = ckalloc(bytesNeeded);
+ dictPtr->bytes = Tcl_Alloc(bytesNeeded);
dst = dictPtr->bytes;
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
@@ -563,7 +563,7 @@ UpdateStringOfDict(
dictPtr->bytes[dictPtr->length] = '\0';
if (flagPtr != localFlags) {
- ckfree(flagPtr);
+ Tcl_Free(flagPtr);
}
}
@@ -594,7 +594,7 @@ SetDictFromAny(
{
Tcl_HashEntry *hPtr;
int isNew;
- Dict *dict = ckalloc(sizeof(Dict));
+ Dict *dict = Tcl_Alloc(sizeof(Dict));
InitChainTable(dict);
@@ -661,7 +661,7 @@ SetDictFromAny(
} else {
/* Avoid double copy */
TclNewObj(keyPtr);
- keyPtr->bytes = ckalloc((unsigned) elemSize + 1);
+ keyPtr->bytes = Tcl_Alloc((unsigned) elemSize + 1);
keyPtr->length = TclCopyAndCollapse(elemSize, elemStart,
keyPtr->bytes);
}
@@ -677,7 +677,7 @@ SetDictFromAny(
} else {
/* Avoid double copy */
TclNewObj(valuePtr);
- valuePtr->bytes = ckalloc((unsigned) elemSize + 1);
+ valuePtr->bytes = Tcl_Alloc((unsigned) elemSize + 1);
valuePtr->length = TclCopyAndCollapse(elemSize, elemStart,
valuePtr->bytes);
}
@@ -718,7 +718,7 @@ SetDictFromAny(
}
errorInFindDictElement:
DeleteChainTable(dict);
- ckfree(dict);
+ Tcl_Free(dict);
return TCL_ERROR;
}
@@ -1370,7 +1370,7 @@ Tcl_NewDictObj(void)
TclNewObj(dictPtr);
TclInvalidateStringRep(dictPtr);
- dict = ckalloc(sizeof(Dict));
+ dict = Tcl_Alloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -1420,7 +1420,7 @@ Tcl_DbNewDictObj(
TclDbNewObj(dictPtr, file, line);
TclInvalidateStringRep(dictPtr);
- dict = ckalloc(sizeof(Dict));
+ dict = Tcl_Alloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 1;
dict->chain = NULL;
@@ -2034,7 +2034,7 @@ DictInfoCmd(
statsStr = Tcl_HashStats(&dict->table);
Tcl_SetObjResult(interp, Tcl_NewStringObj(statsStr, -1));
- ckfree(statsStr);
+ Tcl_Free(statsStr);
return TCL_OK;
}