author | Craig Mohrman <craig.mohrman@oracle.com> |
Fri, 05 Aug 2011 22:11:53 -0700 | |
changeset 461 | edabdd6aff23 |
permissions | -rw-r--r-- |
461
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1 |
--- APC-3.0.19/apc_cache.c.ORIG Mon Feb 9 07:35:10 2009 |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2 |
+++ APC-3.0.19/apc_cache.c Mon Feb 9 07:35:21 2009 |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
3 |
@@ -62,23 +62,9 @@ |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
4 |
/* }}} */ |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
5 |
|
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
6 |
/* {{{ string_nhash_8 */ |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
7 |
-static unsigned int string_nhash_8(const char *s, size_t len) |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
8 |
+static inline unsigned long string_nhash_8(const char *s, size_t len) |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
9 |
{ |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
10 |
- register const unsigned int *iv = (const unsigned int *)s; |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
11 |
- register unsigned int h = 0; |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
12 |
- register const unsigned int *e = (const unsigned int *)(s + len - (len % sizeof(unsigned int))); |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
13 |
- |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
14 |
- for(;iv<e;iv++) { |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
15 |
- h += *iv; |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
16 |
- h = (h << 7) | (h >> ((8*sizeof(unsigned int)) - 7)); |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
17 |
- } |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
18 |
- s = (const char *)iv; |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
19 |
- for(len %= sizeof(unsigned int);len;len--) { |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
20 |
- h += *(s++); |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
21 |
- } |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
22 |
- h ^= (h >> 13); |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
23 |
- h ^= (h >> 7); |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
24 |
- return h; |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
25 |
+ return zend_inline_hash_func(s, len); |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
26 |
} |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
27 |
/* }}} */ |
edabdd6aff23
7072982 move php from sfw to userland consolidation
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
28 |