small changes, prevent memory leak, add free and change cachehashtable_t
authoradash <adash>
Wed, 14 Mar 2007 00:40:20 +0000 (00:40 +0000)
committeradash <adash>
Wed, 14 Mar 2007 00:40:20 +0000 (00:40 +0000)
to chashtable

Robust/src/Runtime/DSTM/interface/clookup.c
Robust/src/Runtime/DSTM/interface/dstm.h

index 4fd11cbe05a4ed298c5119ac031e1008872c508f..aa01469829a04de04e6d6a72e329dfe20bbcbf94 100644 (file)
@@ -13,6 +13,7 @@ chashtable_t *chashCreate(unsigned int size, float loadfactor) {
         // Allocate space for the hash table 
        if((nodes = calloc(size, sizeof(chashlistnode_t))) == NULL) { 
                printf("Calloc error %s %d\n", __FILE__, __LINE__);
+               free(ctable);
                return NULL;
        }       
 
index d7278ea6052ee12acc6a082bc49f9f3a6ee07180..fdfd0951a349e16502d1b51f99bb48e382b0742f 100644 (file)
@@ -26,7 +26,7 @@ typedef struct objstr {
 
 typedef struct transrecord {
        objstr_t *cache;
-       cachehashtable_t *lookupTable;
+       chashtable_t *lookupTable;
 } transrecord_t;
 
 /* Initialize main object store and lookup tables, start server thread. */