From ffe3839e5de7709048776712380f55f294d72c51 Mon Sep 17 00:00:00 2001 From: adash Date: Mon, 19 Mar 2007 02:27:25 +0000 Subject: [PATCH] Remove files --- Robust/src/Runtime/DSTM/interface/hashtable.h | 30 ------------ .../src/Runtime/DSTM/interface/servertest.c | 49 ------------------- 2 files changed, 79 deletions(-) delete mode 100644 Robust/src/Runtime/DSTM/interface/hashtable.h delete mode 100644 Robust/src/Runtime/DSTM/interface/servertest.c diff --git a/Robust/src/Runtime/DSTM/interface/hashtable.h b/Robust/src/Runtime/DSTM/interface/hashtable.h deleted file mode 100644 index 54940542..00000000 --- a/Robust/src/Runtime/DSTM/interface/hashtable.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _HASHTABLE_H_ -#define _HASHTABLE_H_ - -#define LOADFACTOR 0.75 -#define HASH_SIZE 100 - -typedef struct hashlistnode { - unsigned int key; - void *val; //this can be cast to another type or used to point to a larger structure - struct hashlistnode *next; -} hashlistnode_t; - -typedef struct hashtable { - hashlistnode_t *table; // points to beginning of hash table - unsigned int size; - unsigned int numelements; - float loadfactor; -} hashtable_t; - -/* Prototypes for hash*/ -hashtable_t *hashCreate(unsigned int size, float loadfactor); -unsigned int hashFunction(hashtable_t *table, unsigned int key); -void hashInsert(hashtable_t *table, unsigned int key, void *val); -void *hashSearch(hashtable_t *table, unsigned int key); //returns val, NULL if not found -int hashRemove(hashtable_t *table, unsigned int key); //returns -1 if not found -void hashResize(hashtable_t *table, unsigned int newsize); -/* end hash */ - -#endif - diff --git a/Robust/src/Runtime/DSTM/interface/servertest.c b/Robust/src/Runtime/DSTM/interface/servertest.c deleted file mode 100644 index da4298e5..00000000 --- a/Robust/src/Runtime/DSTM/interface/servertest.c +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include "dstm.h" - -extern objstr_t *mainobjstore; -int classsize[]={sizeof(int),sizeof(char),sizeof(short), sizeof(void *)}; - -unsigned int createObjects(transrecord_t *record, unsigned short type) { - objheader_t *header, *tmp; - unsigned int size; - size = sizeof(objheader_t) + classsize[type] ; - header = transCreateObj(record, type); - tmp = (objheader_t *) objstrAlloc(mainobjstore, size); - memcpy(tmp, header, size); - mhashInsert(tmp->oid, tmp); - lhashInsert(tmp->oid, 1); - return 0; -} - -int main() -{ - unsigned int val; - transrecord_t *myTrans; - pthread_t thread_Listen; - - dstmInit(); - pthread_create(&thread_Listen, NULL, dstmListen, NULL); - // Start Transaction - myTrans = transStart(); - - printf("Creating Transaction\n"); - //Create Object1 - if((val = createObjects(myTrans, 0)) != 0) { - printf("Error transCreateObj1"); - } - //Create Object2 - if((val = createObjects(myTrans, 1)) != 0) { - printf("Error transCreateObj2"); - } - //Create Object3 - if((val = createObjects(myTrans, 2)) != 0) { - printf("Error transCreateObj3"); - } - //Create Object4 - if((val = createObjects(myTrans, 3)) != 0) { - printf("Error transCreateObj4"); - } - pthread_join(thread_Listen, NULL); - return 0; -} -- 2.34.1