Subject: | Fix for 64 bit systems |
Devel::LeakTrace::Fast doesn't work on 64 bit systems.
It's mistakenly using 'unsigned int' in 2 places to hold an unsigned long value.
The silent truncation this results in causes all tests to fail.
This wouldn't be visible on a 32 bit system.
Attached patch fixes this, and causes all tests to pass on 32 and 64 bit builds.
[admittedly both on the same machine :-) but I have confidence that it's more
generally correct]
Nicholas Clark
Subject: | 64.patch |
--- hash.c~ 2007-11-22 20:34:28.000000000 +0100
+++ hash.c 2014-03-19 16:16:13.110812686 +0100
@@ -255,7 +255,7 @@
}
int hash_delete_key( hash * h, const void *key, size_t key_len ) {
- unsigned int hc = _hash( key, key_len );
+ unsigned long hc = _hash( key, key_len );
long *sp = &h->slot[hc % h->cap];
long s = *sp;
INST_I( delete_key );
@@ -294,7 +294,7 @@
* object must match the life of the hash.
*/
int hash_put( hash * h, const void *key, size_t key_len, void *val ) {
- unsigned int hc = _hash( key, key_len );
+ unsigned long hc = _hash( key, key_len );
hash_slot *sl;
int err;
long s;