summaryrefslogtreecommitdiffstats
path: root/generic/tclIORChan.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/tclIORChan.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/tclIORChan.c')
-rw-r--r--generic/tclIORChan.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index c21398c..b93a511 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -385,7 +385,7 @@ static void SrcExitProc(ClientData clientData);
#define FreeReceivedError(p) \
if ((p)->base.mustFree) { \
- ckfree((p)->base.msgStr); \
+ Tcl_Free((p)->base.msgStr); \
}
#define PassReceivedErrorInterp(i,p) \
if ((i) != NULL) { \
@@ -670,7 +670,7 @@ TclChanCreateObjCmd(
* as the actual channel type.
*/
- Tcl_ChannelType *clonePtr = ckalloc(sizeof(Tcl_ChannelType));
+ Tcl_ChannelType *clonePtr = Tcl_Alloc(sizeof(Tcl_ChannelType));
memcpy(clonePtr, &tclRChannelType, sizeof(Tcl_ChannelType));
@@ -725,7 +725,7 @@ TclChanCreateObjCmd(
Tcl_DecrRefCount(rcPtr->name);
Tcl_DecrRefCount(rcPtr->methods);
Tcl_DecrRefCount(rcPtr->cmd);
- ckfree(rcPtr);
+ Tcl_Free(rcPtr);
return TCL_ERROR;
#undef MODE
@@ -923,7 +923,7 @@ TclChanPostEventObjCmd(
Tcl_NotifyChannel(chan, events);
#if TCL_THREADS
} else {
- ReflectEvent *ev = ckalloc(sizeof(ReflectEvent));
+ ReflectEvent *ev = Tcl_Alloc(sizeof(ReflectEvent));
ev->header.proc = ReflectEventRun;
ev->events = events;
@@ -1158,7 +1158,7 @@ ReflectClose(
tctPtr = ((Channel *)rcPtr->chan)->typePtr;
if (tctPtr && tctPtr != &tclRChannelType) {
- ckfree((void *)tctPtr);
+ Tcl_Free((void *)tctPtr);
((Channel *)rcPtr->chan)->typePtr = NULL;
}
Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel);
@@ -1227,7 +1227,7 @@ ReflectClose(
#endif
tctPtr = ((Channel *)rcPtr->chan)->typePtr;
if (tctPtr && tctPtr != &tclRChannelType) {
- ckfree((void *)tctPtr);
+ Tcl_Free((void *)tctPtr);
((Channel *)rcPtr->chan)->typePtr = NULL;
}
Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel);
@@ -2124,7 +2124,7 @@ NewReflectedChannel(
ReflectedChannel *rcPtr;
MethodName mn = METH_BLOCKING;
- rcPtr = ckalloc(sizeof(ReflectedChannel));
+ rcPtr = Tcl_Alloc(sizeof(ReflectedChannel));
/* rcPtr->chan: Assigned by caller. Dummy data here. */
@@ -2209,7 +2209,7 @@ FreeReflectedChannel(
if (rcPtr->cmd) {
Tcl_DecrRefCount(rcPtr->cmd);
}
- ckfree(rcPtr);
+ Tcl_Free(rcPtr);
}
/*
@@ -2445,7 +2445,7 @@ GetReflectedChannelMap(
ReflectedChannelMap *rcmPtr = Tcl_GetAssocData(interp, RCMKEY, NULL);
if (rcmPtr == NULL) {
- rcmPtr = ckalloc(sizeof(ReflectedChannelMap));
+ rcmPtr = Tcl_Alloc(sizeof(ReflectedChannelMap));
Tcl_InitHashTable(&rcmPtr->map, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, RCMKEY,
(Tcl_InterpDeleteProc *) DeleteReflectedChannelMap, rcmPtr);
@@ -2534,7 +2534,7 @@ DeleteReflectedChannelMap(
Tcl_DeleteHashEntry(hPtr);
}
Tcl_DeleteHashTable(&rcmPtr->map);
- ckfree(&rcmPtr->map);
+ Tcl_Free(&rcmPtr->map);
#if TCL_THREADS
/*
@@ -2646,7 +2646,7 @@ GetThreadReflectedChannelMap(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->rcmPtr) {
- tsdPtr->rcmPtr = ckalloc(sizeof(ReflectedChannelMap));
+ tsdPtr->rcmPtr = Tcl_Alloc(sizeof(ReflectedChannelMap));
Tcl_InitHashTable(&tsdPtr->rcmPtr->map, TCL_STRING_KEYS);
Tcl_CreateThreadExitHandler(DeleteThreadReflectedChannelMap, NULL);
}
@@ -2769,7 +2769,7 @@ DeleteThreadReflectedChannelMap(
MarkDead(rcPtr);
Tcl_DeleteHashEntry(hPtr);
}
- ckfree(rcmPtr);
+ Tcl_Free(rcmPtr);
}
static void
@@ -2809,8 +2809,8 @@ ForwardOpToHandlerThread(
* Create and initialize the event and data structures.
*/
- evPtr = ckalloc(sizeof(ForwardingEvent));
- resultPtr = ckalloc(sizeof(ForwardingResult));
+ evPtr = Tcl_Alloc(sizeof(ForwardingEvent));
+ resultPtr = Tcl_Alloc(sizeof(ForwardingResult));
evPtr->event.proc = ForwardProc;
evPtr->resultPtr = resultPtr;
@@ -2892,7 +2892,7 @@ ForwardOpToHandlerThread(
Tcl_DeleteThreadExitHandler(SrcExitProc, evPtr);
- ckfree(resultPtr);
+ Tcl_Free(resultPtr);
}
static int
@@ -3187,7 +3187,7 @@ ForwardProc(
* Odd number of elements is wrong. [x].
*/
- char *buf = ckalloc(200);
+ char *buf = Tcl_Alloc(200);
sprintf(buf,
"{Expected list with even number of elements, got %d %s instead}",
listc, (listc == 1 ? "element" : "elements"));
@@ -3297,7 +3297,7 @@ ForwardSetObjError(
const char *msgStr = TclGetStringFromObj(obj, &len);
len++;
- ForwardSetDynamicError(paramPtr, ckalloc(len));
+ ForwardSetDynamicError(paramPtr, Tcl_Alloc(len));
memcpy(paramPtr->base.msgStr, msgStr, (unsigned) len);
}
#endif