Added necessary variable initializations
authorstephey <stephey>
Mon, 25 Oct 2010 22:13:30 +0000 (22:13 +0000)
committerstephey <stephey>
Mon, 25 Oct 2010 22:13:30 +0000 (22:13 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/oooJava/hashRCR.c
Robust/src/Runtime/oooJava/hashStructure.c

index 09352df46bdbf30312244d2763c4f85db4a8f85f..af2d0697f2eb421ba01b6db11dc596b290cd267d 100644 (file)
@@ -478,6 +478,7 @@ public class BuildCode {
       //initializes data structures needed for the RCR traverser
       if(state.RCR && rcr != null) {
         outmethod.println("  initializeStructsRCR();");
+        outmethod.println("  createAndFillMasterHashStructureArray();");
       }
     }
 
index c90a1f475fc09b0cb9793d7d736d01750da1db28..f3d62d67387f27e2725611d81f659d848a25805e 100644 (file)
@@ -10,9 +10,9 @@
 #define SHIFTBITS 4
 #endif
 
-__thread dchashlistnode_t *dc_c_table;
-__thread dchashlistnode_t *dc_c_list;
-__thread dcliststruct_t *dc_c_structs;
+__thread dchashlistnode_t *dc_c_table = NULL;
+__thread dchashlistnode_t *dc_c_list = NULL;
+__thread dcliststruct_t *dc_c_structs= NULL;
 __thread unsigned int dc_c_size;
 __thread unsigned INTPTR dc_c_mask;
 __thread unsigned int dc_c_numelements;
@@ -33,6 +33,10 @@ void hashRCRCreate(unsigned int size, double loadfactor) {
 }
 
 void hashRCRreset() {
+  if(dc_c_table == NULL) {
+    hashRCRCreate(128, 0.75);
+  }
+
   dchashlistnode_t *ptr = dc_c_table;
 
   if (dc_c_numelements<(dc_c_size>>SHIFTBITS)) {
index 1fcd5ce2d10756f8bda69e567b42d28e71af2ecc..790c55f4342288deb1e29c95defad1d9cfbaa864 100644 (file)
@@ -39,6 +39,7 @@ inline enqueuerecord(struct rcrRecord *rcrrec, int tmpkey, BinItem_rcr *item) {
 
 //NOTE: only temporary
 void rcr_createMasterHashTableArray(int maxSize){
+  allHashStructures = (HashStructure **) malloc(sizeof(HashStructure *) * maxSize);
 }
 
 HashStructure* rcr_createHashtable(int sizeofWaitingQueue){