From 67e59792a1cbb304673e87f39db723563928a072 Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 2 Dec 2009 17:48:25 +0000 Subject: [PATCH] bug fixes in altmlookup --- .../src/Runtime/DSTM/interface/altmlookup.c | 20 +++++++++---------- .../src/Runtime/DSTM/interface/altmlookup.h | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Robust/src/Runtime/DSTM/interface/altmlookup.c b/Robust/src/Runtime/DSTM/interface/altmlookup.c index e321e700..88768dde 100644 --- a/Robust/src/Runtime/DSTM/interface/altmlookup.c +++ b/Robust/src/Runtime/DSTM/interface/altmlookup.c @@ -1,4 +1,4 @@ -#include "mlookup.h" +#include "altmlookup.h" #include "dsmlock.h" #include @@ -21,7 +21,7 @@ unsigned int mhashCreate(unsigned int size, double loadfactor) { mlookup.loadfactor = loadfactor; int i; for(i=0;i>1; - volatile unsigned int * lockptr=&mlookup.lockarray[keyindex&LOCKMASK].lock; + volatile unsigned int * lockptr=&mlookup.larray[keyindex&LOCKMASK].lock; while(!write_trylock(lockptr)) { sched_yield(); } @@ -68,7 +68,7 @@ void *mhashSearch(unsigned int key) { int index; unsigned int keyindex=(key&mlookup.mask)>>1; - volatile unsigned int * lockptr=&mlookup.lockarray[keyindex&LOCKMASK].lock; + volatile unsigned int * lockptr=&mlookup.larray[keyindex&LOCKMASK].lock; while(!write_trylock(lockptr)) { sched_yield(); @@ -95,7 +95,7 @@ unsigned int mhashRemove(unsigned int key) { mhashlistnode_t *ptr, *node; unsigned int keyindex=(key&mlookup.mask)>>1; - volatile unsigned int * lockptr=&mlookup.lockarray[keyindex&LOCKMASK].lock; + volatile unsigned int * lockptr=&mlookup.larray[keyindex&LOCKMASK].lock; while(!write_trylock(lockptr)) { sched_yield(); @@ -105,7 +105,7 @@ unsigned int mhashRemove(unsigned int key) { for (; curr != NULL; curr = curr->next) { if (curr->key == key) { - atomic_dec(&mlookup.numelements); + atomic_dec(&(mlookup.numelements)); if ((curr == &ptr[index]) && (curr->next == NULL)) { curr->key = 0; curr->val = NULL; @@ -129,14 +129,14 @@ unsigned int mhashRemove(unsigned int key) { } // Resize table -void int mhashResize(unsigned int newsize) { +void mhashResize(unsigned int newsize) { mhashlistnode_t *node, *curr; int isfirst; unsigned int i,index; unsigned int mask; for(i=0;i