Subject: remove stray calls to Tcl_Alloc and friends: the core should only use ckalloc to allow MEM_DEBUG to work properly

From: mig <mig>
Date: Wed, 2 Jan 2013 19:27:09 +0000

---
 ChangeLog                     | 7 +++++++
 generic/tclExecute.c          | 6 +++---
 generic/tclTomMathInterface.c | 6 +++---
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ef01964..4779e0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-02  Miguel Sofer  <[email-masked]>
+
+	* generic/tclEnsemble.c:  Remove stray calls to Tcl_Alloc and
+	* generic/tclExecute.c:   friends: the core should only use ckalloc
+	* generic/tclIORTrans.c:  to allow MEM_DEBUG to work properly
+	* generic/tclTomMathInterface.c:
+
 2012-12-31  Donal K. Fellows  <[email-masked]>
 
 	* doc/string.n: Noted the obsolescence of the 'bytelength',
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index f2efa0f..229d7c6 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -1063,7 +1063,7 @@ TclStackFree(
     Tcl_Obj **markerPtr;
 
     if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
-	Tcl_Free((char *) freePtr);
+	ckfree((char *) freePtr);
 	return;
     }
 
@@ -1112,7 +1112,7 @@ TclStackAlloc(
     int numWords = (numBytes + (sizeof(Tcl_Obj *) - 1))/sizeof(Tcl_Obj *);
 
     if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
-	return (void *) Tcl_Alloc(numBytes);
+	return (void *) ckalloc(numBytes);
     }
 
     return (void *) StackAllocWords(interp, numWords);
@@ -1131,7 +1131,7 @@ TclStackRealloc(
     int numWords;
 
     if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
-	return (void *) Tcl_Realloc((char *) ptr, numBytes);
+	return (void *) ckrealloc((char *) ptr, numBytes);
     }
 
     eePtr = iPtr->execEnvPtr;
diff --git a/generic/tclTomMathInterface.c b/generic/tclTomMathInterface.c
index 6e5dac3..89c1132 100644
--- a/generic/tclTomMathInterface.c
+++ b/generic/tclTomMathInterface.c
@@ -112,7 +112,7 @@ extern void *
 TclBNAlloc(
     size_t x)
 {
-    return (void *) Tcl_Alloc((unsigned int) x);
+    return (void *) ckalloc((unsigned int) x);
 }
 
 /*
@@ -136,7 +136,7 @@ TclBNRealloc(
     void *p,
     size_t s)
 {
-    return (void *) Tcl_Realloc((char *) p, (unsigned int) s);
+    return (void *) ckrealloc((char *) p, (unsigned int) s);
 }
 
 /*
@@ -162,7 +162,7 @@ extern void
 TclBNFree(
     void *p)
 {
-    Tcl_Free((char *) p);
+    ckfree((char *) p);
 }
 #endif
 
-- 
cgit v0.12