From: bdemsky Date: Thu, 7 Apr 2011 01:21:33 +0000 (+0000) Subject: hack seems to help a little...power isn't going to have good performance... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=98e2071b363a05583bee11e95a3f5b66e64069ff;p=IRC.git hack seems to help a little...power isn't going to have good performance... --- diff --git a/Robust/src/Runtime/oooJava/hashStructure.c b/Robust/src/Runtime/oooJava/hashStructure.c index 1cda5680..6f7d7b7e 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.c +++ b/Robust/src/Runtime/oooJava/hashStructure.c @@ -67,14 +67,26 @@ HashStructure* rcr_createHashtable(){ return newTable; } +#define WBMAX 256 +__thread WriteBinItem_rcr* bank=NULL; +__thread offset=WBMAX; + + WriteBinItem_rcr* rcr_createWriteBinItem( HashStructure* htable ){ //WriteBinItem_rcr* binitem=(WriteBinItem_rcr*)poolalloc( htable->memPoolWrite ); - WriteBinItem_rcr* binitem=(WriteBinItem_rcr*)RUNMALLOC(sizeof(WriteBinItem_rcr)); + if (offset==WBMAX) { + bank=(WriteBinItem_rcr*)RUNMALLOC(sizeof(WriteBinItem_rcr)*WBMAX); + offset=0; + } + + WriteBinItem_rcr* binitem=&bank[offset++]; + //(WriteBinItem_rcr*)RUNMALLOC(sizeof(WriteBinItem_rcr)); binitem->item.type=WRITEBIN; binitem->item.next=NULL; return binitem; } + ReadBinItem_rcr* rcr_createReadBinItem( HashStructure* htable ){ //ReadBinItem_rcr* binitem=(ReadBinItem_rcr*)poolalloc( htable->memPoolRead ); ReadBinItem_rcr* binitem=(ReadBinItem_rcr*)RUNMALLOC(sizeof(ReadBinItem_rcr));