64-bit cleanness:
- Use SizeT instead of UInt for new_mem_stack and all the related functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2907 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index c5e2b51..14b188a 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -250,8 +250,7 @@
 /*------------------------------------------------------------*/
 
 static /* __inline__ */
-void set_address_range_perms ( Addr a, UInt len, 
-                               UInt example_a_bit )
+void set_address_range_perms ( Addr a, SizeT len, UInt example_a_bit )
 {
    UChar     abyte8;
    UInt      sm_off;
@@ -357,14 +356,14 @@
 
 /* Set permissions for address ranges ... */
 
-static void ac_make_noaccess ( Addr a, UInt len )
+static void ac_make_noaccess ( Addr a, SizeT len )
 {
    PROF_EVENT(35);
    DEBUG("ac_make_noaccess(%p, %x)\n", a, len);
    set_address_range_perms ( a, len, VGM_BIT_INVALID );
 }
 
-static void ac_make_accessible ( Addr a, UInt len )
+static void ac_make_accessible ( Addr a, SizeT len )
 {
    PROF_EVENT(38);
    DEBUG("ac_make_accessible(%p, %x)\n", a, len);
@@ -449,7 +448,7 @@
 
 /* Block-copy permissions (needed for implementing realloc()). */
 
-static void ac_copy_address_range_state ( Addr src, Addr dst, UInt len )
+static void ac_copy_address_range_state ( Addr src, Addr dst, SizeT len )
 {
    UInt i;
 
@@ -469,7 +468,7 @@
    know what it is. */
 
 static __inline__
-Bool ac_check_accessible ( Addr a, UInt len, Addr* bad_addr )
+Bool ac_check_accessible ( Addr a, SizeT len, Addr* bad_addr )
 {
    UInt  i;
    UChar abit;
@@ -488,7 +487,7 @@
 
 /* The opposite; check that an address range is inaccessible. */
 static
-Bool ac_check_noaccess ( Addr a, UInt len, Addr* bad_addr )
+Bool ac_check_noaccess ( Addr a, SizeT len, Addr* bad_addr )
 {
    UInt  i;
    UChar abit;
@@ -535,7 +534,7 @@
 
 static __inline__
 void ac_check_is_accessible ( CorePart part, ThreadId tid,
-                              Char* s, Addr base, UInt size, Bool isWrite )
+                              Char* s, Addr base, SizeT size, Bool isWrite )
 {
    Bool ok;
    Addr bad_addr;
@@ -573,14 +572,14 @@
 
 static
 void ac_check_is_writable ( CorePart part, ThreadId tid,
-                            Char* s, Addr base, UInt size )
+                            Char* s, Addr base, SizeT size )
 {
    ac_check_is_accessible ( part, tid, s, base, size, /*isWrite*/True );
 }
 
 static
 void ac_check_is_readable ( CorePart part, ThreadId tid,
-                            Char* s, Addr base, UInt size )
+                            Char* s, Addr base, SizeT size )
 {     
    ac_check_is_accessible ( part, tid, s, base, size, /*isWrite*/False );
 }
@@ -605,7 +604,7 @@
 }
 
 static
-void ac_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx )
+void ac_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx )
 {
    /* Ignore the permissions, just make it readable.  Seems to work... */
    DEBUG("new_mem_startup(%p, %u, rr=%u, ww=%u, xx=%u)\n", a,len,rr,ww,xx);
@@ -613,13 +612,13 @@
 }
 
 static
-void ac_new_mem_heap ( Addr a, UInt len, Bool is_inited )
+void ac_new_mem_heap ( Addr a, SizeT len, Bool is_inited )
 {
    ac_make_accessible(a, len);
 }
 
 static
-void ac_set_perms (Addr a, UInt len, Bool rr, Bool ww, Bool xx)
+void ac_set_perms (Addr a, SizeT len, Bool rr, Bool ww, Bool xx)
 {
    DEBUG("ac_set_perms(%p, %u, rr=%u ww=%u, xx=%u)\n",
                               a, len, rr, ww, xx);
diff --git a/coregrind/toolfuncs.def b/coregrind/toolfuncs.def
index 1a98ea7..73ff43e 100644
--- a/coregrind/toolfuncs.def
+++ b/coregrind/toolfuncs.def
@@ -179,16 +179,16 @@
 ## malloc() et al.  See above how to do this.)
 
 ## These ones occur at startup, upon some signals, and upon some syscalls
-void,	new_mem_startup,	Addr a, UInt len, Bool rr, Bool ww, Bool xx
-void,	new_mem_stack_signal,	Addr a, UInt len
-void,	new_mem_brk,	Addr a, UInt len
-void,	new_mem_mmap,	Addr a, UInt len, Bool rr, Bool ww, Bool xx
+void,	new_mem_startup,	Addr a, SizeT len, Bool rr, Bool ww, Bool xx
+void,	new_mem_stack_signal,	Addr a, SizeT len
+void,	new_mem_brk,	Addr a, SizeT len
+void,	new_mem_mmap,	Addr a, SizeT len, Bool rr, Bool ww, Bool xx
 
-void,	copy_mem_remap,	Addr from, Addr to, UInt len
-void,	change_mem_mprotect,	Addr a, UInt len, Bool rr, Bool ww, Bool xx
-void,	die_mem_stack_signal,	Addr a, UInt len
-void,	die_mem_brk,	Addr a, UInt len
-void,	die_mem_munmap,	Addr a, UInt len
+void,	copy_mem_remap,	Addr from, Addr to, SizeT len
+void,	change_mem_mprotect,	Addr a, SizeT len, Bool rr, Bool ww, Bool xx
+void,	die_mem_stack_signal,	Addr a, SizeT len
+void,	die_mem_brk,	Addr a, SizeT len
+void,	die_mem_munmap,	Addr a, SizeT len
 
 ## These ones are called when %esp changes.  A tool could track these itself
 ## (except for ban_mem_stack) but it's much easier to use the core's help.
@@ -204,26 +204,26 @@
 void,	new_mem_stack_12,	Addr new_ESP
 void,	new_mem_stack_16,	Addr new_ESP
 void,	new_mem_stack_32,	Addr new_ESP
-void,	new_mem_stack,	Addr a, UInt len
+void,	new_mem_stack,	Addr a, SizeT len
 
 void,	die_mem_stack_4,	Addr die_ESP
 void,	die_mem_stack_8,	Addr die_ESP
 void,	die_mem_stack_12,	Addr die_ESP
 void,	die_mem_stack_16,	Addr die_ESP
 void,	die_mem_stack_32,	Addr die_ESP
-void,	die_mem_stack,	Addr a, UInt len
+void,	die_mem_stack,	Addr a, SizeT len
 
 ## Used for redzone at end of thread stacks
-void,	ban_mem_stack,	Addr a, UInt len
+void,	ban_mem_stack,	Addr a, SizeT len
 
 ## These ones occur around syscalls, signal handling, etc
-void,	pre_mem_read,	CorePart part, ThreadId tid, Char* s, Addr a, UInt size
+void,	pre_mem_read,	CorePart part, ThreadId tid, Char* s, Addr a, SizeT size
 void,	pre_mem_read_asciiz,	CorePart part, ThreadId tid, Char* s, Addr a
-void,	pre_mem_write,	CorePart part, ThreadId tid, Char* s, Addr a, UInt size
+void,	pre_mem_write,	CorePart part, ThreadId tid, Char* s, Addr a, SizeT size
 ## Not implemented yet -- have to add in lots of places, which is a
 ## pain.  Won't bother unless/until there's a need.
-## void (*post_mem_read)  ( ThreadState* tst, Char* s, Addr a, UInt size );
-void,	post_mem_write,	Addr a, UInt size
+## void (*post_mem_read)  ( ThreadState* tst, Char* s, Addr a, SizeT size );
+void,	post_mem_write,	Addr a, SizeT size
 
 
 ## Register events -- if `shadow_regs' need is set, all should probably be
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index 9560d24..c6a57dd 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -1585,7 +1585,7 @@
 }
 
 static
-void set_address_range_state ( Addr a, UInt len /* in bytes */, 
+void set_address_range_state ( Addr a, SizeT len /* in bytes */, 
                                VgeInitStatus status )
 {
    Addr end;
@@ -1660,19 +1660,19 @@
 }
 
 
-static void make_segment_readable ( Addr a, UInt len )
+static void make_segment_readable ( Addr a, SizeT len )
 {
    //PROF_EVENT(??);    PPP
    set_address_range_state ( a, len, Vge_SegmentInit );
 }
 
-static void make_writable ( Addr a, UInt len )
+static void make_writable ( Addr a, SizeT len )
 {
    //PROF_EVENT(36);  PPP
    set_address_range_state( a, len, Vge_VirginInit );
 }
 
-static void make_readable ( Addr a, UInt len )
+static void make_readable ( Addr a, SizeT len )
 {
    //PROF_EVENT(37);  PPP
    set_address_range_state( a, len, Vge_VirginInit );
@@ -1680,7 +1680,7 @@
 
 
 /* Block-copy states (needed for implementing realloc()). */
-static void copy_address_range_state(Addr src, Addr dst, UInt len)
+static void copy_address_range_state(Addr src, Addr dst, SizeT len)
 {
    UInt i;
 
@@ -1693,25 +1693,25 @@
 }
 
 // SSS: put these somewhere better
-static void eraser_mem_read (Addr a, UInt data_size, ThreadId tid);
-static void eraser_mem_write(Addr a, UInt data_size, ThreadId tid);
+static void eraser_mem_read (Addr a, SizeT data_size, ThreadId tid);
+static void eraser_mem_write(Addr a, SizeT data_size, ThreadId tid);
 
 static void eraser_mem_help_read_1(Addr a) REGPARM(1);
 static void eraser_mem_help_read_2(Addr a) REGPARM(1);
 static void eraser_mem_help_read_4(Addr a) REGPARM(1);
-static void eraser_mem_help_read_N(Addr a, UInt size) REGPARM(2);
+static void eraser_mem_help_read_N(Addr a, SizeT size) REGPARM(2);
 
 static void eraser_mem_help_write_1(Addr a, UInt val) REGPARM(2);
 static void eraser_mem_help_write_2(Addr a, UInt val) REGPARM(2);
 static void eraser_mem_help_write_4(Addr a, UInt val) REGPARM(2);
-static void eraser_mem_help_write_N(Addr a, UInt size) REGPARM(2);
+static void eraser_mem_help_write_N(Addr a, SizeT size) REGPARM(2);
 
 static void bus_lock(void);
 static void bus_unlock(void);
 
 static
 void eraser_pre_mem_read(CorePart part, ThreadId tid,
-                         Char* s, Addr base, UInt size )
+                         Char* s, Addr base, SizeT size )
 {
    if (tid > 50) { VG_(printf)("pid = %d, s = `%s`, part = %d\n", tid, s, part); VG_(skin_panic)("a");}
    eraser_mem_read(base, size, tid);
@@ -1726,7 +1726,7 @@
 
 static
 void eraser_pre_mem_write(CorePart part, ThreadId tid,
-                          Char* s, Addr base, UInt size )
+                          Char* s, Addr base, SizeT size )
 {
    eraser_mem_write(base, size, tid);
 }
@@ -1734,7 +1734,7 @@
 
 
 static
-void eraser_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx )
+void eraser_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx )
 {
    /* Ignore the permissions, just make it readable.  Seems to work... */
    make_segment_readable(a, len);
@@ -1742,7 +1742,7 @@
 
 
 static
-void eraser_new_mem_heap ( Addr a, UInt len, Bool is_inited )
+void eraser_new_mem_heap ( Addr a, SizeT len, Bool is_inited )
 {
    if (is_inited) {
       make_readable(a, len);
@@ -1752,7 +1752,7 @@
 }
 
 static
-void eraser_set_perms (Addr a, UInt len,
+void eraser_set_perms (Addr a, SizeT len,
                        Bool rr, Bool ww, Bool xx)
 {
    if      (rr) make_readable(a, len);
@@ -1761,13 +1761,13 @@
 }
 
 static
-void eraser_new_mem_stack_private(Addr a, UInt len)
+void eraser_new_mem_stack_private(Addr a, SizeT len)
 {
    set_address_range_state(a, len, Vge_NonVirginInit);
 }
 
 static
-void eraser_new_mem_stack(Addr a, UInt len)
+void eraser_new_mem_stack(Addr a, SizeT len)
 {
    set_address_range_state(a, len, Vge_VirginInit);
 }
@@ -3034,7 +3034,7 @@
    }
 }
 
-static void eraser_mem_read(Addr a, UInt size, ThreadId tid)
+static void eraser_mem_read(Addr a, SizeT size, ThreadId tid)
 {
    Addr end;
 
@@ -3139,7 +3139,7 @@
    }
 }
 
-static void eraser_mem_write(Addr a, UInt size, ThreadId tid)
+static void eraser_mem_write(Addr a, SizeT size, ThreadId tid)
 {
    Addr     end;
 
@@ -3167,7 +3167,7 @@
    eraser_mem_read(a, 4, VG_(get_current_tid)());
 }
 
-REGPARM(2) static void eraser_mem_help_read_N(Addr a, UInt size)
+REGPARM(2) static void eraser_mem_help_read_N(Addr a, SizeT size)
 {
    eraser_mem_read(a, size, VG_(get_current_tid)());
 }
@@ -3187,7 +3187,7 @@
    if (*(UInt *)a != val)
       eraser_mem_write(a, 4, VG_(get_current_tid)());
 }
-REGPARM(2) static void eraser_mem_help_write_N(Addr a, UInt size)
+REGPARM(2) static void eraser_mem_help_write_N(Addr a, SizeT size)
 {
    eraser_mem_write(a, size, VG_(get_current_tid)());
 }
@@ -3374,7 +3374,7 @@
 
 void SK_(post_clo_init)(void)
 {
-   void (*stack_tracker)(Addr a, UInt len);
+   void (*stack_tracker)(Addr a, SizeT len);
    
    if (clo_execontext) {
       execontext_map = VG_(malloc)(sizeof(ExeContextMap *) * 65536);
diff --git a/memcheck/mac_malloc_wrappers.c b/memcheck/mac_malloc_wrappers.c
index e272f20..23f59b6 100644
--- a/memcheck/mac_malloc_wrappers.c
+++ b/memcheck/mac_malloc_wrappers.c
@@ -45,13 +45,13 @@
 UInt VG_(vg_malloc_redzone_szB) = 16;
 
 /* Function pointers for the two tools to track interesting events. */
-void (*MAC_(new_mem_heap)) ( Addr a, UInt len, Bool is_inited )  = NULL;
-void (*MAC_(ban_mem_heap)) ( Addr a, UInt len )                  = NULL;
-void (*MAC_(die_mem_heap)) ( Addr a, UInt len )                  = NULL;
-void (*MAC_(copy_mem_heap))( Addr from, Addr to, UInt len )      = NULL;
+void (*MAC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited )  = NULL;
+void (*MAC_(ban_mem_heap)) ( Addr a, SizeT len )                  = NULL;
+void (*MAC_(die_mem_heap)) ( Addr a, SizeT len )                  = NULL;
+void (*MAC_(copy_mem_heap))( Addr from, Addr to, SizeT len )      = NULL;
 
 /* Function pointers for internal sanity checking. */
-Bool (*MAC_(check_noaccess))( Addr a, UInt len, Addr* bad_addr ) = NULL;
+Bool (*MAC_(check_noaccess))( Addr a, SizeT len, Addr* bad_addr ) = NULL;
 
 
 /*------------------------------------------------------------*/
diff --git a/memcheck/mac_shared.h b/memcheck/mac_shared.h
index b009e51..d9a84ab 100644
--- a/memcheck/mac_shared.h
+++ b/memcheck/mac_shared.h
@@ -277,13 +277,13 @@
 extern VgHashTable MAC_(mempool_list);
 
 /* Function pointers for the two tools to track interesting events. */
-extern void (*MAC_(new_mem_heap)) ( Addr a, UInt len, Bool is_inited );
-extern void (*MAC_(ban_mem_heap)) ( Addr a, UInt len );
-extern void (*MAC_(die_mem_heap)) ( Addr a, UInt len );
-extern void (*MAC_(copy_mem_heap))( Addr from, Addr to, UInt len );
+extern void (*MAC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited );
+extern void (*MAC_(ban_mem_heap)) ( Addr a, SizeT len );
+extern void (*MAC_(die_mem_heap)) ( Addr a, SizeT len );
+extern void (*MAC_(copy_mem_heap))( Addr from, Addr to, SizeT len );
 
 /* Function pointers for internal sanity checking. */
-extern Bool (*MAC_(check_noaccess))( Addr a, UInt len, Addr* bad_addr );
+extern Bool (*MAC_(check_noaccess))( Addr a, SizeT len, Addr* bad_addr );
 
 /* Used in describe_addr() */
 extern Bool (*MAC_(describe_addr_supp))    ( Addr a, AddrInfo* ai );
@@ -357,8 +357,8 @@
 extern REGPARM(1) void MAC_(die_mem_stack_16) ( Addr old_ESP );
 extern REGPARM(1) void MAC_(new_mem_stack_32) ( Addr old_ESP );
 extern REGPARM(1) void MAC_(die_mem_stack_32) ( Addr old_ESP );
-extern            void MAC_(die_mem_stack) ( Addr a, UInt len);
-extern            void MAC_(new_mem_stack) ( Addr a, UInt len);
+extern            void MAC_(die_mem_stack) ( Addr a, SizeT len);
+extern            void MAC_(new_mem_stack) ( Addr a, SizeT len);
 
 
 /*------------------------------------------------------------*/
@@ -520,13 +520,13 @@
    }                                                                          \
 }                                                                             \
                                                                               \
-void MAC_(new_mem_stack) ( Addr a, UInt len )                                 \
+void MAC_(new_mem_stack) ( Addr a, SizeT len )                                \
 {                                                                             \
    PROF_EVENT(115);                                                           \
    UNALIGNED_NEW ( a, len );                                                  \
 }                                                                             \
                                                                               \
-void MAC_(die_mem_stack) ( Addr a, UInt len )                                 \
+void MAC_(die_mem_stack) ( Addr a, SizeT len )                                \
 {                                                                             \
    PROF_EVENT(125);                                                           \
    UNALIGNED_DIE ( a, len );                                                  \
diff --git a/memcheck/mc_include.h b/memcheck/mc_include.h
index 948cef8..9d97925 100644
--- a/memcheck/mc_include.h
+++ b/memcheck/mc_include.h
@@ -129,17 +129,17 @@
 extern REGPARM(1) UInt MC_(helperc_LOADV2)  ( Addr );
 extern REGPARM(1) UInt MC_(helperc_LOADV4)  ( Addr );
 
-extern REGPARM(2) void MC_(fpu_write_check) ( Addr addr, Int size );
-extern REGPARM(2) void MC_(fpu_read_check)  ( Addr addr, Int size );
+extern REGPARM(2) void MC_(fpu_write_check) ( Addr addr, SizeT size );
+extern REGPARM(2) void MC_(fpu_read_check)  ( Addr addr, SizeT size );
 
 
 /* For client requests */
-extern void MC_(make_noaccess) ( Addr a, UInt len );
-extern void MC_(make_readable) ( Addr a, UInt len );
-extern void MC_(make_writable) ( Addr a, UInt len );
+extern void MC_(make_noaccess) ( Addr a, SizeT len );
+extern void MC_(make_readable) ( Addr a, SizeT len );
+extern void MC_(make_writable) ( Addr a, SizeT len );
 
-extern Bool MC_(check_writable) ( Addr a, UInt len, Addr* bad_addr );
-extern Bool MC_(check_readable) ( Addr a, UInt len, Addr* bad_addr );
+extern Bool MC_(check_writable) ( Addr a, SizeT len, Addr* bad_addr );
+extern Bool MC_(check_readable) ( Addr a, SizeT len, Addr* bad_addr );
 
 extern void MC_(detect_memory_leaks) ( void );
 
@@ -147,7 +147,7 @@
                ThreadId tid,
                Addr dataV, 
                Addr vbitsV, 
-               UInt size, 
+               SizeT size, 
                Bool setting /* True <=> set vbits,  False <=> get vbits */ 
             );
 
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index a8369cf..34dff45 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -99,8 +99,8 @@
 static void mc_wr_V4_SLOWLY ( Addr a, UInt vbytes );
 static void mc_wr_V2_SLOWLY ( Addr a, UInt vbytes );
 static void mc_wr_V1_SLOWLY ( Addr a, UInt vbytes );
-static void mc_fpu_read_check_SLOWLY ( Addr addr, Int size );
-static void mc_fpu_write_check_SLOWLY ( Addr addr, Int size );
+static void mc_fpu_read_check_SLOWLY  ( Addr addr, SizeT size );
+static void mc_fpu_write_check_SLOWLY ( Addr addr, SizeT size );
 
 /*------------------------------------------------------------*/
 /*--- Data defns.                                          ---*/
@@ -266,7 +266,7 @@
 /*--- Setting permissions over address ranges.             ---*/
 /*------------------------------------------------------------*/
 
-static void set_address_range_perms ( Addr a, UInt len, 
+static void set_address_range_perms ( Addr a, SizeT len, 
                                       UInt example_a_bit,
                                       UInt example_v_bit )
 {
@@ -389,24 +389,24 @@
 
 /* Set permissions for address ranges ... */
 
-void MC_(make_noaccess) ( Addr a, UInt len )
+void MC_(make_noaccess) ( Addr a, SizeT len )
 {
    PROF_EVENT(35);
-   DEBUG("MC_(make_noaccess)(%p, %x)\n", a, len);
+   DEBUG("MC_(make_noaccess)(%p, %llu)\n", a, (ULong)len);
    set_address_range_perms ( a, len, VGM_BIT_INVALID, VGM_BIT_INVALID );
 }
 
-void MC_(make_writable) ( Addr a, UInt len )
+void MC_(make_writable) ( Addr a, SizeT len )
 {
    PROF_EVENT(36);
-   DEBUG("MC_(make_writable)(%p, %x)\n", a, len);
+   DEBUG("MC_(make_writable)(%p, %llu)\n", a, (ULong)len);
    set_address_range_perms ( a, len, VGM_BIT_VALID, VGM_BIT_INVALID );
 }
 
-void MC_(make_readable) ( Addr a, UInt len )
+void MC_(make_readable) ( Addr a, SizeT len )
 {
    PROF_EVENT(37);
-   DEBUG("MC_(make_readable)(%p, 0x%x)\n", a, len);
+   DEBUG("MC_(make_readable)(%p, %llu)\n", a, (ULong)len);
    set_address_range_perms ( a, len, VGM_BIT_VALID, VGM_BIT_VALID );
 }
 
@@ -491,9 +491,9 @@
                     );
 
 /* Block-copy permissions (needed for implementing realloc()). */
-static void mc_copy_address_range_state ( Addr src, Addr dst, UInt len )
+static void mc_copy_address_range_state ( Addr src, Addr dst, SizeT len )
 {
-   UInt i;
+   SizeT i;
 
    DEBUG("mc_copy_address_range_state\n");
 
@@ -516,9 +516,9 @@
    returns False, and if bad_addr is non-NULL, sets *bad_addr to
    indicate the lowest failing address.  Functions below are
    similar. */
-Bool MC_(check_noaccess) ( Addr a, UInt len, Addr* bad_addr )
+Bool MC_(check_noaccess) ( Addr a, SizeT len, Addr* bad_addr )
 {
-   UInt  i;
+   SizeT i;
    UChar abit;
    PROF_EVENT(42);
    for (i = 0; i < len; i++) {
@@ -533,9 +533,9 @@
    return True;
 }
 
-Bool MC_(check_writable) ( Addr a, UInt len, Addr* bad_addr )
+Bool MC_(check_writable) ( Addr a, SizeT len, Addr* bad_addr )
 {
-   UInt  i;
+   SizeT i;
    UChar abit;
    PROF_EVENT(42);
    for (i = 0; i < len; i++) {
@@ -550,9 +550,9 @@
    return True;
 }
 
-Bool MC_(check_readable) ( Addr a, UInt len, Addr* bad_addr )
+Bool MC_(check_readable) ( Addr a, SizeT len, Addr* bad_addr )
 {
-   UInt  i;
+   SizeT i;
    UChar abit;
    UChar vbyte;
 
@@ -603,7 +603,7 @@
 
 static
 void mc_check_is_writable ( CorePart part, ThreadId tid, Char* s,
-                            Addr base, UInt size )
+                            Addr base, SizeT size )
 {
    Bool ok;
    Addr bad_addr;
@@ -634,7 +634,7 @@
 
 static
 void mc_check_is_readable ( CorePart part, ThreadId tid, Char* s,
-                            Addr base, UInt size )
+                            Addr base, SizeT size )
 {     
    Bool ok;
    Addr bad_addr;
@@ -688,15 +688,16 @@
 
 
 static
-void mc_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx )
+void mc_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx )
 {
    /* Ignore the permissions, just make it readable.  Seems to work... */
-   DEBUG("mc_new_mem_startup(%p, %u, rr=%u, ww=%u, xx=%u)\n", a,len,rr,ww,xx);
+   DEBUG("mc_new_mem_startup(%p, %llu, rr=%u, ww=%u, xx=%u)\n",
+         a,(ULong)len,rr,ww,xx);
    MC_(make_readable)(a, len);
 }
 
 static
-void mc_new_mem_heap ( Addr a, UInt len, Bool is_inited )
+void mc_new_mem_heap ( Addr a, SizeT len, Bool is_inited )
 {
    if (is_inited) {
       MC_(make_readable)(a, len);
@@ -706,9 +707,10 @@
 }
 
 static
-void mc_set_perms (Addr a, UInt len, Bool rr, Bool ww, Bool xx)
+void mc_set_perms (Addr a, SizeT len, Bool rr, Bool ww, Bool xx)
 {
-   DEBUG("mc_set_perms(%p, %u, rr=%u ww=%u, xx=%u)\n", a, len, rr, ww, xx);
+   DEBUG("mc_set_perms(%p, %llu, rr=%u ww=%u, xx=%u)\n",
+         a, (ULong)len, rr, ww, xx);
    if      (rr) MC_(make_readable)(a, len);
    else if (ww) MC_(make_writable)(a, len);
    else         MC_(make_noaccess)(a, len);
@@ -1108,7 +1110,7 @@
    ------------------------------------------------------------------ */
 
 REGPARM(2)
-void MC_(fpu_read_check) ( Addr addr, Int size )
+void MC_(fpu_read_check) ( Addr addr, SizeT size )
 {
    /* Ensure the read area is both addressible and valid (ie,
       readable).  If there's an address error, don't report a value
@@ -1200,7 +1202,7 @@
 
 
 REGPARM(2)
-void MC_(fpu_write_check) ( Addr addr, Int size )
+void MC_(fpu_write_check) ( Addr addr, SizeT size )
 {
    /* Ensure the written area is addressible, and moan if otherwise.
       If it is addressible, make it valid, otherwise invalid. 
@@ -1290,7 +1292,7 @@
    there's an addr error, don't report a value error even if it
    exists. */
 
-void mc_fpu_read_check_SLOWLY ( Addr addr, Int size )
+void mc_fpu_read_check_SLOWLY ( Addr addr, SizeT size )
 {
    Int  i;
    Bool aerr = False;
@@ -1316,7 +1318,7 @@
 /* Generic version.  Test for addr errors.  Valid addresses are
    given valid values, and invalid addresses invalid values. */
 
-void mc_fpu_write_check_SLOWLY ( Addr addr, Int size )
+void mc_fpu_write_check_SLOWLY ( Addr addr, SizeT size )
 {
    Int  i;
    Addr a_here;
@@ -1350,7 +1352,7 @@
    ThreadId tid,
    Addr dataV, 
    Addr vbitsV, 
-   UInt size, 
+   SizeT size, 
    Bool setting /* True <=> set vbits,  False <=> get vbits */ 
 )
 {
@@ -1358,8 +1360,8 @@
    Bool addressibleV = True;
    UInt* data  = (UInt*)dataV;
    UInt* vbits = (UInt*)vbitsV;
-   UInt  szW   = size / 4; /* sigh */
-   UInt  i;
+   SizeT szW   = size / 4; /* sigh */
+   SizeT i;
    UInt* dataP  = NULL; /* bogus init to keep gcc happy */
    UInt* vbitsP = NULL; /* ditto */