From 98e2071b363a05583bee11e95a3f5b66e64069ff Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 7 Apr 2011 01:21:33 +0000 Subject: [PATCH] hack seems to help a little...power isn't going to have good performance... --- Robust/src/Runtime/oooJava/hashStructure.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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)); -- 2.34.1