Changeset 253
- Timestamp:
- 07/29/06 11:44:09 (2 years ago)
- Files:
-
- eaccelerator/trunk/ChangeLog (modified) (3 diffs)
- eaccelerator/trunk/cache.c (modified) (4 diffs)
- eaccelerator/trunk/eaccelerator.c (modified) (3 diffs)
- eaccelerator/trunk/eaccelerator.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ChangeLog
r252 r253 1 2006-07-30 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 3 * Don't use our own hash function, the one from the ZE is extremely much 4 faster and provides a much better distribution. 5 * Don't compile the user cache code one no feature is being compiled. 6 1 7 2006-07-29 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 8 … … 40 46 41 47 2006-07-24 Hans Rakers <hans at parse dot nl> 42 * Fix for ticket #47 and #63, related to problems restoring empty43 strings and empty string array keys from the disk cache.48 * Fix for ticket #47 and #63, related to problems restoring empty 49 strings and empty string array keys from the disk cache. 44 50 45 51 2006-07-23 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> … … 78 84 2006-06-30 Hans Rakers <hans at parse dot nl> 79 85 80 * Added ability to sort table columns by clicking on the table81 headings in the control panel82 * Quick & dirty fix for eaccelerator_clear to work with the new83 cache dir hashing. This still needs to be done for win32.84 85 eaccelerator_clean still needs some fixing to work with the86 dir hashing.86 * Added ability to sort table columns by clicking on the table 87 headings in the control panel 88 * Quick & dirty fix for eaccelerator_clear to work with the new 89 cache dir hashing. This still needs to be done for win32. 90 91 eaccelerator_clean still needs some fixing to work with the 92 dir hashing. 87 93 88 94 2006-06-27 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> eaccelerator/trunk/cache.c
r237 r253 29 29 #include "eaccelerator_version.h" 30 30 31 #if def HAVE_EACCELERATOR31 #if defined(HAVE_EACCELERATOR) && (defined(WITH_EACCELERATOR_CONTENT_CACHING) || defined(WITH_EACCELERATOR_SESSIONS) || defined(WITH_EACCELERATOR_SHM)) 32 32 33 33 #include "zend.h" … … 249 249 q->size = size; 250 250 EAG(mem) += offsetof(mm_user_cache_entry, key) + xlen + 1; 251 q->hv = hash_mm(xkey, xlen);251 q->hv = zend_get_hash_value(xkey, xlen); 252 252 memcpy(q->key, xkey, xlen + 1); 253 253 memcpy(&q->value, val, sizeof(zval)); … … 336 336 337 337 xkey = build_key(key, key_len, &xlen TSRMLS_CC); 338 hv = hash_mm(xkey, xlen);338 hv = zend_get_hash_value(xkey, xlen); 339 339 slot = hv & EA_USER_HASH_MAX; 340 340 … … 532 532 if (eaccelerator_mm_instance != NULL && (where == eaccelerator_shm_and_disk || 533 533 where == eaccelerator_shm || where == eaccelerator_shm_only)) { 534 hv = hash_mm(xkey, xlen);534 hv = zend_get_hash_value(xkey, xlen); 535 535 slot = hv & EA_USER_HASH_MAX; 536 536 eaccelerator/trunk/eaccelerator.c
r252 r253 121 121 /******************************************************************************/ 122 122 123 inline unsigned int hash_mm(const char *data, int len) {124 unsigned int h;125 const char *e = data + len;126 for (h = 2166136261U; data < e; ) {127 h *= 16777619;128 h ^= *data++;129 }130 return h;131 }132 133 123 /* Find a script entry with the given hash key */ 134 124 static mm_cache_entry* hash_find_mm(const char *key, … … 142 132 hv = buf->st_dev + buf->st_ino; 143 133 #else 144 hv = hash_mm(key, strlen(key));134 hv = zend_get_hash_value(key, strlen(key)); 145 135 #endif 146 136 slot = hv & EA_HASH_MAX; … … 209 199 slot = (x->st_dev + x->st_ino) & EA_HASH_MAX; 210 200 #else 211 x->hv = hash_mm(x->realfilename, strlen(x->realfilename));201 x->hv = zend_get_hash_value(x->realfilename, strlen(x->realfilename)); 212 202 slot = x->hv & EA_HASH_MAX; 213 203 #endif eaccelerator/trunk/eaccelerator.h
r249 r253 400 400 401 401 unsigned int eaccelerator_crc32 (const char *p, size_t n); 402 int eaccelerator_md5 (char *s, const char *prefix, const char *key TSRMLS_DC); 403 404 unsigned int hash_mm(const char *data, int len); 402 int eaccelerator_md5 (char *s, const char *prefix, const char *key TSRMLS_DC); 405 403 406 404 # ifdef WITH_EACCELERATOR_OPTIMIZER