summaryrefslogtreecommitdiffstats
path: root/generic/tclCkalloc.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-06 13:24:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-06 13:24:34 (GMT)
commitf47fbe763af41b982b9233bca58795cd34b2c259 (patch)
tree6111744e3899c0f3d7cec0be1ee9cc5dcf62375f /generic/tclCkalloc.c
parentfc83e1302a252a49290fc451791661208dfca026 (diff)
downloadtcl-f47fbe763af41b982b9233bca58795cd34b2c259.zip
tcl-f47fbe763af41b982b9233bca58795cd34b2c259.tar.gz
tcl-f47fbe763af41b982b9233bca58795cd34b2c259.tar.bz2
Fix build with --enable-symbols=mem
Diffstat (limited to 'generic/tclCkalloc.c')
-rw-r--r--generic/tclCkalloc.c62
1 files changed, 57 insertions, 5 deletions
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 6efef86..e37d0b8 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -20,7 +20,9 @@
#define FALSE 0
#define TRUE 1
+#undef Tcl_Alloc
#undef Tcl_Free
+#undef Tcl_Realloc
#undef Tcl_AttemptAlloc
#undef Tcl_AttemptRealloc
@@ -690,7 +692,7 @@ Tcl_DbCkrealloc(
if (copySize > memp->length) {
copySize = memp->length;
}
- newPtr = Tcl_DbCkalloc(size, file, line);
+ newPtr = (char *)Tcl_DbCkalloc(size, file, line);
memcpy(newPtr, ptr, copySize);
Tcl_DbCkfree(ptr, file, line);
return newPtr;
@@ -721,7 +723,7 @@ Tcl_AttemptDbCkrealloc(
if (copySize > memp->length) {
copySize = memp->length;
}
- newPtr = Tcl_AttemptDbCkalloc(size, file, line);
+ newPtr = (char *)Tcl_AttemptDbCkalloc(size, file, line);
if (newPtr == NULL) {
return NULL;
}
@@ -734,6 +736,59 @@ Tcl_AttemptDbCkrealloc(
/*
*----------------------------------------------------------------------
*
+ * Tcl_Alloc, et al. --
+ *
+ * These functions are defined in terms of the debugging versions when
+ * TCL_MEM_DEBUG is set.
+ *
+ * Results:
+ * Same as the debug versions.
+ *
+ * Side effects:
+ * Same as the debug versions.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void *
+Tcl_Alloc(
+ size_t size)
+{
+ return Tcl_DbCkalloc(size, "unknown", 0);
+}
+
+void *
+Tcl_AttemptAlloc(
+ size_t size)
+{
+ return Tcl_AttemptDbCkalloc(size, "unknown", 0);
+}
+
+void
+Tcl_Free(
+ void *ptr)
+{
+ Tcl_DbCkfree(ptr, "unknown", 0);
+}
+
+void *
+Tcl_Realloc(
+ void *ptr,
+ size_t size)
+{
+ return Tcl_DbCkrealloc(ptr, size, "unknown", 0);
+}
+void *
+Tcl_AttemptRealloc(
+ void *ptr,
+ size_t size)
+{
+ return Tcl_AttemptDbCkrealloc(ptr, size, "unknown", 0);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* MemoryCmd --
*
* Implements the Tcl "memory" command, which provides Tcl-level control
@@ -992,7 +1047,6 @@ Tcl_InitMemory(
*----------------------------------------------------------------------
*/
-#undef Tcl_Alloc
void *
Tcl_Alloc(
size_t size)
@@ -1069,7 +1123,6 @@ Tcl_AttemptDbCkalloc(
*----------------------------------------------------------------------
*/
-#undef Tcl_Realloc
void *
Tcl_Realloc(
void *ptr,
@@ -1141,7 +1194,6 @@ Tcl_AttemptDbCkrealloc(
*----------------------------------------------------------------------
*/
-#undef Tcl_Free
void
Tcl_Free(
void *ptr)