diff --git a/ChangeLog b/ChangeLog index c243a0e1c..437108dee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2010-10-24 suzuki toshiya + + Change the type of FT_MEM_VAL() from FT_ULong to FT_PtrDist. + + On LLP64 platforms (e.g. Win64), unsigned long (32-bit) + cannot cover the memory address (64-bit). FT_MEM_VAL() is + used for hashing only and not dereferred, so using signed + type FT_PtrDist is safe. + + * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the + return value from FT_ULong to FT_PtrDist. + (ft_mem_table_resize): The type of hash is changed to + FT_PtrDist. (ft_mem_table_get_nodep): Ditto. + 2010-10-24 suzuki toshiya Replace "%lx" for memory address by "%p", LLP64 platforms. diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c index 160269d19..12fed04bb 100644 --- a/src/base/ftdbgmem.c +++ b/src/base/ftdbgmem.c @@ -47,7 +47,7 @@ typedef struct FT_MemTableRec_* FT_MemTable; -#define FT_MEM_VAL( addr ) ((FT_ULong)(FT_Pointer)( addr )) +#define FT_MEM_VAL( addr ) ((FT_PtrDist)(FT_Pointer)( addr )) /* * This structure holds statistics for a single allocation/release @@ -275,7 +275,7 @@ for ( i = 0; i < table->size; i++ ) { FT_MemNode node, next, *pnode; - FT_ULong hash; + FT_PtrDist hash; node = table->buckets[i]; @@ -430,7 +430,7 @@ ft_mem_table_get_nodep( FT_MemTable table, FT_Byte* address ) { - FT_ULong hash; + FT_PtrDist hash; FT_MemNode *pnode, node;