summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.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 /win/tclWinPipe.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 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index cf0b80f..8537ca5 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -403,7 +403,7 @@ PipeCheckProc(
if (needEvent) {
infoPtr->flags |= PIPE_PENDING;
- evPtr = ckalloc(sizeof(PipeEvent));
+ evPtr = Tcl_Alloc(sizeof(PipeEvent));
evPtr->header.proc = PipeEventProc;
evPtr->infoPtr = infoPtr;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -434,7 +434,7 @@ TclWinMakeFile(
{
WinFile *filePtr;
- filePtr = ckalloc(sizeof(WinFile));
+ filePtr = Tcl_Alloc(sizeof(WinFile));
filePtr->type = WIN_FILE;
filePtr->handle = handle;
@@ -826,7 +826,7 @@ TclpCloseFile(
if (filePtr->handle != NULL &&
CloseHandle(filePtr->handle) == FALSE) {
TclWinConvertError(GetLastError());
- ckfree(filePtr);
+ Tcl_Free(filePtr);
return -1;
}
}
@@ -836,7 +836,7 @@ TclpCloseFile(
Tcl_Panic("TclpCloseFile: unexpected file type");
}
- ckfree(filePtr);
+ Tcl_Free(filePtr);
return 0;
}
@@ -1676,7 +1676,7 @@ TclpCreateCommandChannel(
Tcl_Pid *pidPtr) /* An array of process identifiers. */
{
char channelName[16 + TCL_INTEGER_SPACE];
- PipeInfo *infoPtr = ckalloc(sizeof(PipeInfo));
+ PipeInfo *infoPtr = Tcl_Alloc(sizeof(PipeInfo));
PipeInit();
@@ -1840,7 +1840,7 @@ TclGetAndDetachPids(
}
Tcl_SetObjResult(interp, pidsObj);
if (pipePtr->numPids > 0) {
- ckfree(pipePtr->pidPtr);
+ Tcl_Free(pipePtr->pidPtr);
pipePtr->numPids = 0;
}
}
@@ -2027,7 +2027,7 @@ PipeClose2Proc(
errChan = Tcl_MakeFileChannel((ClientData) filePtr->handle,
TCL_READABLE);
- ckfree(filePtr);
+ Tcl_Free(filePtr);
} else {
errChan = NULL;
}
@@ -2037,14 +2037,14 @@ PipeClose2Proc(
}
if (pipePtr->numPids > 0) {
- ckfree(pipePtr->pidPtr);
+ Tcl_Free(pipePtr->pidPtr);
}
if (pipePtr->writeBuf != NULL) {
- ckfree(pipePtr->writeBuf);
+ Tcl_Free(pipePtr->writeBuf);
}
- ckfree(pipePtr);
+ Tcl_Free(pipePtr);
if (errorCode == 0) {
return result;
@@ -2212,10 +2212,10 @@ PipeOutputProc(
*/
if (infoPtr->writeBuf) {
- ckfree(infoPtr->writeBuf);
+ Tcl_Free(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = ckalloc(toWrite);
+ infoPtr->writeBuf = Tcl_Alloc(toWrite);
}
memcpy(infoPtr->writeBuf, buf, (size_t) toWrite);
infoPtr->toWrite = toWrite;
@@ -2594,7 +2594,7 @@ Tcl_WaitPid(
*/
CloseHandle(infoPtr->hProcess);
- ckfree(infoPtr);
+ Tcl_Free(infoPtr);
return result;
}
@@ -2622,7 +2622,7 @@ TclWinAddProcess(
void *hProcess, /* Handle to process */
unsigned long id) /* Global process identifier */
{
- ProcInfo *procPtr = ckalloc(sizeof(ProcInfo));
+ ProcInfo *procPtr = Tcl_Alloc(sizeof(ProcInfo));
PipeInit();
@@ -3196,7 +3196,7 @@ TclPipeThreadCreateTI(
#ifndef _PTI_USE_CKALLOC
pipeTI = malloc(sizeof(TclPipeThreadInfo));
#else
- pipeTI = ckalloc(sizeof(TclPipeThreadInfo));
+ pipeTI = Tcl_Alloc(sizeof(TclPipeThreadInfo));
#endif
pipeTI->evControl = CreateEvent(NULL, FALSE, FALSE, NULL);
pipeTI->state = PTI_STATE_IDLE;
@@ -3507,7 +3507,7 @@ TclPipeThreadStop(
# ifndef _PTI_USE_CKALLOC
free(pipeTI);
# else
- ckfree(pipeTI);
+ Tcl_Free(pipeTI);
# endif
}
}
@@ -3555,7 +3555,7 @@ TclPipeThreadExit(
# ifndef _PTI_USE_CKALLOC
free(pipeTI);
# else
- ckfree(pipeTI);
+ Tcl_Free(pipeTI);
/* be sure all subsystems used are finalized */
Tcl_FinalizeThread();
# endif