Changeset 359
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svnmerge-integrated changed
/branches/1.2 merged: 358
- Property svnmerge-integrated changed
-
trunk/xcache.c
r353 r359 729 729 #define HASH_STR(s) HASH_STR_L(s, strlen(s) + 1) 730 730 #define HASH_NUM(n) HASH(n) 731 static inline xc_hash_value_t xc_hash_fold(xc_hash_value_t hvalue, const xc_hash_t *hasher) /* {{{ fold hash bits as needed */ 732 { 733 xc_hash_value_t folded = 0; 734 while (hvalue) { 735 folded ^= (hvalue & hasher->mask); 736 hvalue >>= hasher->bits; 737 } 738 return folded; 739 } 740 /* }}} */ 731 741 static inline xc_hash_value_t xc_entry_hash_name(xc_entry_t *xce TSRMLS_DC) /* {{{ */ 732 742 { … … 843 853 844 854 hv = xc_entry_hash_php(xce TSRMLS_CC); 845 cacheid = (hv & xc_php_hcache.mask);855 cacheid = xc_hash_fold(hv, &xc_php_hcache); 846 856 xce->cache = xc_php_caches[cacheid]; 847 hv >>= xc_php_hcache.bits; 848 xce->hvalue = (hv & xc_php_hentry.mask); 857 xce->hvalue = xc_hash_fold(hv, &xc_php_hentry); 849 858 850 859 xce->type = XC_TYPE_PHP;
Note: See TracChangeset
for help on using the changeset viewer.

