From dee8fb32b884aa4a316b4e04434f7bb063012291 Mon Sep 17 00:00:00 2001 From: stephey Date: Mon, 25 Oct 2010 22:13:30 +0000 Subject: [PATCH] Added necessary variable initializations --- Robust/src/IR/Flat/BuildCode.java | 1 + Robust/src/Runtime/oooJava/hashRCR.c | 10 +++++++--- Robust/src/Runtime/oooJava/hashStructure.c | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 09352df4..af2d0697 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -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();"); } } diff --git a/Robust/src/Runtime/oooJava/hashRCR.c b/Robust/src/Runtime/oooJava/hashRCR.c index c90a1f47..f3d62d67 100644 --- a/Robust/src/Runtime/oooJava/hashRCR.c +++ b/Robust/src/Runtime/oooJava/hashRCR.c @@ -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)) { diff --git a/Robust/src/Runtime/oooJava/hashStructure.c b/Robust/src/Runtime/oooJava/hashStructure.c index 1fcd5ce2..790c55f4 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.c +++ b/Robust/src/Runtime/oooJava/hashStructure.c @@ -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){ -- 2.34.1