summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclCkalloc.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ce1d1c8..21bc07c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclCkalloc.c: [Bug #3197864] pointer truncation on Win64
+ TCL_MEM_DEBUG builds
+
2011-03-16 Don Porter <dgp@users.sourceforge.net>
* generic/tclBasic.c: Some rewrites to eliminate calls to
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 32fd84d..9d63ebf 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -81,7 +81,7 @@ static struct mem_header *allocHead = NULL; /* List of allocated structures */
*/
#define BODY_OFFSET \
- ((unsigned long) (&((struct mem_header *) 0)->body))
+ ((size_t) (&((struct mem_header *) 0)->body))
static int total_mallocs = 0;
static int total_frees = 0;
@@ -595,7 +595,7 @@ Tcl_DbCkfree(
* words on these machines).
*/
- memp = (struct mem_header *) (((unsigned long) ptr) - BODY_OFFSET);
+ memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
if (alloc_tracing) {
fprintf(stderr, "ckfree %lx %ld %s %d\n",
@@ -672,7 +672,7 @@ Tcl_DbCkrealloc(
* See comment from Tcl_DbCkfree before you change the following line.
*/
- memp = (struct mem_header *) (((unsigned long) ptr) - BODY_OFFSET);
+ memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
copySize = size;
if (copySize > (unsigned int) memp->length) {
@@ -703,7 +703,7 @@ Tcl_AttemptDbCkrealloc(
* See comment from Tcl_DbCkfree before you change the following line.
*/
- memp = (struct mem_header *) (((unsigned long) ptr) - BODY_OFFSET);
+ memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
copySize = size;
if (copySize > (unsigned int) memp->length) {