cvs: pecl /apc apc_cache.c
| From: | George Schlossnagle | Date: | Thu, 26 Jun 2003 15:19:38 +0000 |
| Subject: | cvs: pecl /apc apc_cache.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-324@lists.php.net to get a copy of this message | ||
gschlossnagle Thu Jun 26 11:19:38 2003 EDT
Modified files:
/pecl/apc apc_cache.c
Log:
Reverting your patch again. Sorry, but the exact same error occurs - *slot is still uniitialized
Index: pecl/apc/apc_cache.c
diff -u pecl/apc/apc_cache.c:3.47 pecl/apc/apc_cache.c:3.48
--- pecl/apc/apc_cache.c:3.47 Thu Jun 26 04:52:35 2003
+++ pecl/apc/apc_cache.c Thu Jun 26 11:19:38 2003
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apc_cache.c,v 3.47 2003/06/26 08:52:35 sterling Exp $ */
+/* $Id: apc_cache.c,v 3.48 2003/06/26 15:19:38 gschlossnagle Exp $ */
#include "apc_cache.h"
#include "apc_sem.h"
@@ -57,7 +57,6 @@
header_t* header; /* cache header (stored in SHM) */
slot_t** slots; /* array of cache slots (stored in SHM) */
int num_slots; /* number of slots in cache */
- int mask; /* Mask to find necessary slot */
int gc_ttl; /* maximum time on GC list for a slot */
int lock; /* global semaphore lock */
};
@@ -202,7 +201,6 @@
cache->slots = (slot_t**) (((char*) cache->shmaddr) + sizeof(header_t));
cache->num_slots = num_slots;
- cache->mask = 1 << num_slots;
cache->gc_ttl = gc_ttl;
cache->lock = CREATE_LOCK;
@@ -258,7 +256,7 @@
LOCK(cache);
process_pending_removals(cache);
- slot = &cache->slots[hash(key) & cache->mask];
+ slot = &cache->slots[hash(key) % cache->num_slots];
while (*slot) {
if (key_equals((*slot)->key, key)) {
if ((*slot)->key.mtime < key.mtime) {
@@ -288,7 +286,7 @@
LOCK(cache);
- slot = &cache->slots[hash(key) & cache->mask];
+ slot = &cache->slots[hash(key) % cache->num_slots];
while (*slot) {
if (key_equals((*slot)->key, key)) {
if ((*slot)->key.mtime < key.mtime) {