comparison src/ralloc.c @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents ac0620f6398e
children 0132846995bd
comparison
equal deleted inserted replaced
115:f109f7dabbe2 116:9f59509498e1
755 755
756 /* Compute the hash value for an address. */ 756 /* Compute the hash value for an address. */
757 static int 757 static int
758 MHASH (VM_ADDR addr) 758 MHASH (VM_ADDR addr)
759 { 759 {
760 #if (LONGBITS == 64)
761 unsigned long int addr_shift = (unsigned long int)(addr) >> USELESS_LOWER_ADDRESS_BITS;
762 #else
760 unsigned int addr_shift = (unsigned int)(addr) >> USELESS_LOWER_ADDRESS_BITS; 763 unsigned int addr_shift = (unsigned int)(addr) >> USELESS_LOWER_ADDRESS_BITS;
764 #endif
761 int hval = addr_shift % MHASH_PRIME; /* We could have addresses which are -ve 765 int hval = addr_shift % MHASH_PRIME; /* We could have addresses which are -ve
762 when converted to signed ints */ 766 when converted to signed ints */
763 return ((hval >= 0) ? hval : MHASH_PRIME + hval); 767 return ((hval >= 0) ? hval : MHASH_PRIME + hval);
764 } 768 }
765 769