summaryrefslogtreecommitdiffstats
path: root/generic/tclOOMethod.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOOMethod.c')
-rw-r--r--generic/tclOOMethod.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 8c258f4..e6785f5 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -155,19 +155,19 @@ Tcl_NewInstanceMethod(
int isNew;
if (nameObj == NULL) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = Tcl_Alloc(sizeof(Method));
mPtr->namePtr = NULL;
mPtr->refCount = 1;
goto populate;
}
if (!oPtr->methodsPtr) {
- oPtr->methodsPtr = ckalloc(sizeof(Tcl_HashTable));
+ oPtr->methodsPtr = Tcl_Alloc(sizeof(Tcl_HashTable));
Tcl_InitObjHashTable(oPtr->methodsPtr);
oPtr->flags &= ~USE_CLASS_CACHE;
}
hPtr = Tcl_CreateHashEntry(oPtr->methodsPtr, (char *) nameObj, &isNew);
if (isNew) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = Tcl_Alloc(sizeof(Method));
mPtr->namePtr = nameObj;
mPtr->refCount = 1;
Tcl_IncrRefCount(nameObj);
@@ -227,14 +227,14 @@ Tcl_NewMethod(
int isNew;
if (nameObj == NULL) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = Tcl_Alloc(sizeof(Method));
mPtr->namePtr = NULL;
mPtr->refCount = 1;
goto populate;
}
hPtr = Tcl_CreateHashEntry(&clsPtr->classMethods, (char *)nameObj,&isNew);
if (isNew) {
- mPtr = ckalloc(sizeof(Method));
+ mPtr = Tcl_Alloc(sizeof(Method));
mPtr->refCount = 1;
mPtr->namePtr = nameObj;
Tcl_IncrRefCount(nameObj);
@@ -286,7 +286,7 @@ TclOODelMethodRef(
Tcl_DecrRefCount(mPtr->namePtr);
}
- ckfree(mPtr);
+ Tcl_Free(mPtr);
}
}
@@ -350,7 +350,7 @@ TclOONewProcInstanceMethod(
if (Tcl_ListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
return NULL;
}
- pmPtr = ckalloc(sizeof(ProcedureMethod));
+ pmPtr = Tcl_Alloc(sizeof(ProcedureMethod));
memset(pmPtr, 0, sizeof(ProcedureMethod));
pmPtr->version = TCLOO_PROCEDURE_METHOD_VERSION;
pmPtr->flags = flags & USE_DECLARER_NS;
@@ -359,7 +359,7 @@ TclOONewProcInstanceMethod(
method = TclOOMakeProcInstanceMethod(interp, oPtr, flags, nameObj,
argsObj, bodyObj, &procMethodType, pmPtr, &pmPtr->procPtr);
if (method == NULL) {
- ckfree(pmPtr);
+ Tcl_Free(pmPtr);
} else if (pmPtrPtr != NULL) {
*pmPtrPtr = pmPtr;
}
@@ -411,7 +411,7 @@ TclOONewProcMethod(
procName = (nameObj==NULL ? "<constructor>" : TclGetString(nameObj));
}
- pmPtr = ckalloc(sizeof(ProcedureMethod));
+ pmPtr = Tcl_Alloc(sizeof(ProcedureMethod));
memset(pmPtr, 0, sizeof(ProcedureMethod));
pmPtr->version = TCLOO_PROCEDURE_METHOD_VERSION;
pmPtr->flags = flags & USE_DECLARER_NS;
@@ -424,7 +424,7 @@ TclOONewProcMethod(
Tcl_DecrRefCount(argsObj);
}
if (method == NULL) {
- ckfree(pmPtr);
+ Tcl_Free(pmPtr);
} else if (pmPtrPtr != NULL) {
*pmPtrPtr = pmPtr;
}
@@ -505,12 +505,12 @@ TclOOMakeProcInstanceMethod(
if (context.line
&& (context.nline >= 4) && (context.line[3] >= 0)) {
int isNew;
- CmdFrame *cfPtr = ckalloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = Tcl_Alloc(sizeof(CmdFrame));
Tcl_HashEntry *hPtr;
cfPtr->level = -1;
cfPtr->type = context.type;
- cfPtr->line = ckalloc(sizeof(int));
+ cfPtr->line = Tcl_Alloc(sizeof(int));
cfPtr->line[0] = context.line[3];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -618,12 +618,12 @@ TclOOMakeProcMethod(
if (context.line
&& (context.nline >= 4) && (context.line[3] >= 0)) {
int isNew;
- CmdFrame *cfPtr = ckalloc(sizeof(CmdFrame));
+ CmdFrame *cfPtr = Tcl_Alloc(sizeof(CmdFrame));
Tcl_HashEntry *hPtr;
cfPtr->level = -1;
cfPtr->type = context.type;
- cfPtr->line = ckalloc(sizeof(int));
+ cfPtr->line = Tcl_Alloc(sizeof(int));
cfPtr->line[0] = context.line[3];
cfPtr->nline = 1;
cfPtr->framePtr = NULL;
@@ -1103,7 +1103,7 @@ ProcedureMethodCompiledVarDelete(
TclCleanupVar((Var *) infoPtr->cachedObjectVar, NULL);
}
Tcl_DecrRefCount(infoPtr->variableObj);
- ckfree(infoPtr);
+ Tcl_Free(infoPtr);
}
static int
@@ -1128,7 +1128,7 @@ ProcedureMethodCompiledVarResolver(
return TCL_CONTINUE;
}
- infoPtr = ckalloc(sizeof(OOResVarInfo));
+ infoPtr = Tcl_Alloc(sizeof(OOResVarInfo));
infoPtr->info.fetchProc = ProcedureMethodCompiledVarConnect;
infoPtr->info.deleteProc = ProcedureMethodCompiledVarDelete;
infoPtr->cachedObjectVar = NULL;
@@ -1290,7 +1290,7 @@ DeleteProcedureMethodRecord(
if (pmPtr->deleteClientdataProc) {
pmPtr->deleteClientdataProc(pmPtr->clientData);
}
- ckfree(pmPtr);
+ Tcl_Free(pmPtr);
}
static void
@@ -1348,7 +1348,7 @@ CloneProcedureMethod(
* record.
*/
- pm2Ptr = ckalloc(sizeof(ProcedureMethod));
+ pm2Ptr = Tcl_Alloc(sizeof(ProcedureMethod));
memcpy(pm2Ptr, pmPtr, sizeof(ProcedureMethod));
pm2Ptr->refCount = 1;
Tcl_IncrRefCount(argsObj);
@@ -1357,7 +1357,7 @@ CloneProcedureMethod(
&pm2Ptr->procPtr) != TCL_OK) {
Tcl_DecrRefCount(argsObj);
Tcl_DecrRefCount(bodyObj);
- ckfree(pm2Ptr);
+ Tcl_Free(pm2Ptr);
return TCL_ERROR;
}
Tcl_DecrRefCount(argsObj);
@@ -1402,7 +1402,7 @@ TclOONewForwardInstanceMethod(
return NULL;
}
- fmPtr = ckalloc(sizeof(ForwardMethod));
+ fmPtr = Tcl_Alloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewInstanceMethod(interp, (Tcl_Object) oPtr,
@@ -1441,7 +1441,7 @@ TclOONewForwardMethod(
return NULL;
}
- fmPtr = ckalloc(sizeof(ForwardMethod));
+ fmPtr = Tcl_Alloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewMethod(interp, (Tcl_Class) clsPtr, nameObj,
@@ -1522,7 +1522,7 @@ DeleteForwardMethod(
ForwardMethod *fmPtr = clientData;
Tcl_DecrRefCount(fmPtr->prefixObj);
- ckfree(fmPtr);
+ Tcl_Free(fmPtr);
}
static int
@@ -1532,7 +1532,7 @@ CloneForwardMethod(
ClientData *newClientData)
{
ForwardMethod *fmPtr = clientData;
- ForwardMethod *fm2Ptr = ckalloc(sizeof(ForwardMethod));
+ ForwardMethod *fm2Ptr = Tcl_Alloc(sizeof(ForwardMethod));
fm2Ptr->prefixObj = fmPtr->prefixObj;
Tcl_IncrRefCount(fm2Ptr->prefixObj);