summaryrefslogtreecommitdiffstats
path: root/generic/tclIORTrans.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIORTrans.c')
-rw-r--r--generic/tclIORTrans.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 4841e39..678fcc1 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -366,7 +366,7 @@ static void SrcExitProc(ClientData clientData);
#define FreeReceivedError(p) \
do { \
if ((p)->base.mustFree) { \
- ckfree((p)->base.msgStr); \
+ Tcl_Free((p)->base.msgStr); \
} \
} while (0)
#define PassReceivedErrorInterp(i,p) \
@@ -1759,7 +1759,7 @@ NewReflectedTransform(
Tcl_Obj **listv;
int i;
- rtPtr = ckalloc(sizeof(ReflectedTransform));
+ rtPtr = Tcl_Alloc(sizeof(ReflectedTransform));
/* rtPtr->chan: Assigned by caller. Dummy data here. */
/* rtPtr->methods: Assigned by caller. Dummy data here. */
@@ -1806,7 +1806,7 @@ NewReflectedTransform(
*/
rtPtr->argc = listc + 2;
- rtPtr->argv = ckalloc(sizeof(Tcl_Obj *) * (listc+4));
+ rtPtr->argv = Tcl_Alloc(sizeof(Tcl_Obj *) * (listc+4));
/*
* Duplicate object references.
@@ -1914,8 +1914,8 @@ FreeReflectedTransform(
FreeReflectedTransformArgs(rtPtr);
- ckfree(rtPtr->argv);
- ckfree(rtPtr);
+ Tcl_Free(rtPtr->argv);
+ Tcl_Free(rtPtr);
}
/*
@@ -2114,7 +2114,7 @@ GetReflectedTransformMap(
ReflectedTransformMap *rtmPtr = Tcl_GetAssocData(interp, RTMKEY, NULL);
if (rtmPtr == NULL) {
- rtmPtr = ckalloc(sizeof(ReflectedTransformMap));
+ rtmPtr = Tcl_Alloc(sizeof(ReflectedTransformMap));
Tcl_InitHashTable(&rtmPtr->map, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, RTMKEY,
(Tcl_InterpDeleteProc *) DeleteReflectedTransformMap, rtmPtr);
@@ -2179,7 +2179,7 @@ DeleteReflectedTransformMap(
Tcl_DeleteHashEntry(hPtr);
}
Tcl_DeleteHashTable(&rtmPtr->map);
- ckfree(&rtmPtr->map);
+ Tcl_Free(&rtmPtr->map);
#if TCL_THREADS
/*
@@ -2277,7 +2277,7 @@ GetThreadReflectedTransformMap(void)
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (!tsdPtr->rtmPtr) {
- tsdPtr->rtmPtr = ckalloc(sizeof(ReflectedTransformMap));
+ tsdPtr->rtmPtr = Tcl_Alloc(sizeof(ReflectedTransformMap));
Tcl_InitHashTable(&tsdPtr->rtmPtr->map, TCL_STRING_KEYS);
Tcl_CreateThreadExitHandler(DeleteThreadReflectedTransformMap, NULL);
}
@@ -2335,7 +2335,7 @@ DeleteThreadReflectedTransformMap(
FreeReflectedTransformArgs(rtPtr);
Tcl_DeleteHashEntry(hPtr);
}
- ckfree(rtmPtr);
+ Tcl_Free(rtmPtr);
/*
* Go through the list of pending results and cancel all whose events were
@@ -2412,8 +2412,8 @@ ForwardOpToOwnerThread(
* 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;
@@ -2493,7 +2493,7 @@ ForwardOpToOwnerThread(
Tcl_DeleteThreadExitHandler(SrcExitProc, evPtr);
- ckfree(resultPtr);
+ Tcl_Free(resultPtr);
}
static int
@@ -2597,16 +2597,16 @@ ForwardProc(
* Sent it back to the request originator.
*/
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev;
/* Array of returned bytes */
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = ckalloc(bytec);
+ paramPtr->transform.buf = Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2631,16 +2631,16 @@ ForwardProc(
* Sent it back to the request originator.
*/
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev;
/* Array of returned bytes */
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = ckalloc(bytec);
+ paramPtr->transform.buf = Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2661,15 +2661,15 @@ ForwardProc(
* Sent it back to the request originator.
*/
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = ckalloc(bytec);
+ paramPtr->transform.buf = Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2687,16 +2687,16 @@ ForwardProc(
* Sent it back to the request originator.
*/
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev;
/* Array of returned bytes */
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
paramPtr->transform.size = bytec;
if (bytec > 0) {
- paramPtr->transform.buf = ckalloc(bytec);
+ paramPtr->transform.buf = Tcl_Alloc(bytec);
memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
} else {
paramPtr->transform.buf = NULL;
@@ -2805,12 +2805,12 @@ ForwardSetObjError(
ForwardParam *paramPtr,
Tcl_Obj *obj)
{
- int len;
+ size_t len;
const char *msgStr = TclGetStringFromObj(obj, &len);
len++;
- ForwardSetDynamicError(paramPtr, ckalloc(len));
- memcpy(paramPtr->base.msgStr, msgStr, (unsigned) len);
+ ForwardSetDynamicError(paramPtr, Tcl_Alloc(len));
+ memcpy(paramPtr->base.msgStr, msgStr, len);
}
#endif /* TCL_THREADS */
@@ -2954,7 +2954,7 @@ ResultClear(
return;
}
- ckfree(rPtr->buf);
+ Tcl_Free(rPtr->buf);
rPtr->buf = NULL;
rPtr->allocated = 0;
}
@@ -2989,10 +2989,10 @@ ResultAdd(
if (rPtr->allocated == 0) {
rPtr->allocated = toWrite + RB_INCREMENT;
- rPtr->buf = UCHARP(ckalloc(rPtr->allocated));
+ rPtr->buf = UCHARP(Tcl_Alloc(rPtr->allocated));
} else {
rPtr->allocated += toWrite + RB_INCREMENT;
- rPtr->buf = UCHARP(ckrealloc((char *) rPtr->buf,
+ rPtr->buf = UCHARP(Tcl_Realloc((char *) rPtr->buf,
rPtr->allocated));
}
}
@@ -3080,7 +3080,7 @@ TransformRead(
Tcl_Obj *bufObj)
{
Tcl_Obj *resObj;
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
/*
@@ -3091,7 +3091,7 @@ TransformRead(
if (rtPtr->thread != Tcl_GetCurrentThread()) {
ForwardParam p;
- p.transform.buf = (char *) Tcl_GetByteArrayFromObj(bufObj,
+ p.transform.buf = (char *) TclGetByteArrayFromObj(bufObj,
&(p.transform.size));
ForwardOpToOwnerThread(rtPtr, ForwardedInput, &p);
@@ -3104,7 +3104,7 @@ TransformRead(
*errorCodePtr = EOK;
ResultAdd(&rtPtr->result, UCHARP(p.transform.buf), p.transform.size);
- ckfree(p.transform.buf);
+ Tcl_Free(p.transform.buf);
return 1;
}
#endif /* TCL_THREADS */
@@ -3119,7 +3119,7 @@ TransformRead(
return 0;
}
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
ResultAdd(&rtPtr->result, bytev, bytec);
Tcl_DecrRefCount(resObj); /* Remove reference held from invoke */
@@ -3135,7 +3135,7 @@ TransformWrite(
{
Tcl_Obj *bufObj;
Tcl_Obj *resObj;
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
int res;
@@ -3161,7 +3161,7 @@ TransformWrite(
*errorCodePtr = EOK;
res = Tcl_WriteRaw(rtPtr->parent, (char *) p.transform.buf,
p.transform.size);
- ckfree(p.transform.buf);
+ Tcl_Free(p.transform.buf);
} else
#endif /* TCL_THREADS */
{
@@ -3181,7 +3181,7 @@ TransformWrite(
*errorCodePtr = EOK;
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
res = Tcl_WriteRaw(rtPtr->parent, (char *) bytev, bytec);
Tcl_DecrRefCount(bufObj);
@@ -3202,7 +3202,7 @@ TransformDrain(
int *errorCodePtr)
{
Tcl_Obj *resObj;
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
/*
@@ -3223,7 +3223,7 @@ TransformDrain(
*errorCodePtr = EOK;
ResultAdd(&rtPtr->result, UCHARP(p.transform.buf), p.transform.size);
- ckfree(p.transform.buf);
+ Tcl_Free(p.transform.buf);
} else
#endif /* TCL_THREADS */
{
@@ -3234,7 +3234,7 @@ TransformDrain(
return 0;
}
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
ResultAdd(&rtPtr->result, bytev, bytec);
Tcl_DecrRefCount(resObj); /* Remove reference held from invoke */
@@ -3251,7 +3251,7 @@ TransformFlush(
int op)
{
Tcl_Obj *resObj;
- int bytec; /* Number of returned bytes */
+ size_t bytec; /* Number of returned bytes */
unsigned char *bytev; /* Array of returned bytes */
int res;
@@ -3278,7 +3278,7 @@ TransformFlush(
} else {
res = 0;
}
- ckfree(p.transform.buf);
+ Tcl_Free(p.transform.buf);
} else
#endif /* TCL_THREADS */
{
@@ -3290,7 +3290,7 @@ TransformFlush(
}
if (op == FLUSH_WRITE) {
- bytev = Tcl_GetByteArrayFromObj(resObj, &bytec);
+ bytev = TclGetByteArrayFromObj(resObj, &bytec);
res = Tcl_WriteRaw(rtPtr->parent, (char *) bytev, bytec);
} else {
res = 0;