summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-16 15:53:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-16 15:53:56 (GMT)
commit59c3e3eaf55c2e579958d9b7cf47622f0c76b064 (patch)
tree81f3d15054871cd80b7cddcaf4297e587158a900 /generic
parentee7b1408d0153a47f925c9fe44f82ef80f3a4551 (diff)
parent721410e276eb8b40346512697cd68ed57fe02a6f (diff)
downloadtcl-59c3e3eaf55c2e579958d9b7cf47622f0c76b064.zip
tcl-59c3e3eaf55c2e579958d9b7cf47622f0c76b064.tar.gz
tcl-59c3e3eaf55c2e579958d9b7cf47622f0c76b064.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 5579b47..9d3d6d7 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;
@@ -603,7 +603,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",
@@ -682,7 +682,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) {
@@ -713,7 +713,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) {