summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-16 15:51:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-16 15:51:23 (GMT)
commitdee2f1612dea8ead0ec7def7896d5721d6681035 (patch)
tree119dfe299caa274250c7187e003326188cc5fe75 /generic
parent27d8d9d7d60c59f0ce188d11be7e0bd5c741f8f5 (diff)
downloadtcl-dee2f1612dea8ead0ec7def7896d5721d6681035.zip
tcl-dee2f1612dea8ead0ec7def7896d5721d6681035.tar.gz
tcl-dee2f1612dea8ead0ec7def7896d5721d6681035.tar.bz2
[Bug #3197864] pointer truncation on Win64 TCL_MEM_DEBUG builds
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCkalloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 07fdf4c..e81eaea 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -82,7 +82,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;
@@ -577,7 +577,7 @@ Tcl_DbCkfree(ptr, file, line)
* even though BODY_OFFSET is in 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",
@@ -652,7 +652,7 @@ Tcl_DbCkrealloc(ptr, size, file, line)
* 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) {
@@ -684,7 +684,7 @@ Tcl_AttemptDbCkrealloc(ptr, size, file, line)
* 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) {