Changeset 358
- Timestamp:
- 2007-03-01T11:51:20+01:00 (6 years ago)
- File:
-
- 1 edited
-
branches/1.2/xcache.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/xcache.c
r340 r358 680 680 #define HASH_STR(s) HASH_STR_L(s, strlen(s) + 1) 681 681 #define HASH_NUM(n) HASH(n) 682 static inline xc_hash_value_t xc_hash_fold(xc_hash_value_t hvalue, const xc_hash_t *hasher) /* {{{ fold hash bits as needed */ 683 { 684 xc_hash_value_t folded = 0; 685 while (hvalue) { 686 folded ^= (hvalue & hasher->mask); 687 hvalue >>= hasher->bits; 688 } 689 return folded; 690 } 691 /* }}} */ 682 692 static inline xc_hash_value_t xc_entry_hash_name(xc_entry_t *xce TSRMLS_DC) /* {{{ */ 683 693 { … … 790 800 791 801 hv = xc_entry_hash_php(xce TSRMLS_CC); 792 cacheid = (hv & xc_php_hcache.mask);802 cacheid = xc_hash_fold(hv, &xc_php_hcache); 793 803 xce->cache = xc_php_caches[cacheid]; 794 hv >>= xc_php_hcache.bits; 795 xce->hvalue = (hv & xc_php_hentry.mask); 804 xce->hvalue = xc_hash_fold(hv, &xc_php_hentry); 796 805 797 806 xce->type = XC_TYPE_PHP;
Note: See TracChangeset
for help on using the changeset viewer.

