hashBv::hashBv(Compiler* comp)
{
this->compiler = comp;
- this->log2_hashSize = globalData()->hbvHashSizeLog2;
+ this->log2_hashSize = 0;
int hts = hashtable_size();
nodeArr = getNewVector(hts);
return data->hbvFreeList;
}
-void hashBv::freeVector(hashBvNode* vect, int vectorLength)
-{
- // not enough space to do anything with it
- if (vectorLength < 2)
- {
- return;
- }
-
- hbvFreeListNode* f = (hbvFreeListNode*)vect;
- f->next = globalData()->hbvFreeVectorList;
- globalData()->hbvFreeVectorList = f;
- f->size = vectorLength;
-}
-
void hashBv::hbvFree()
{
Compiler* comp = this->compiler;
return;
}
- int oldSizeLog2 = log2_hashSize;
int log2_newSize = genLog2((unsigned)newSize);
hashBvNode** newNodes = this->getNewVector(newSize);
// this is larger
hashBvNode*** cursors;
- int shiftFactor = this->log2_hashSize - other->log2_hashSize;
int expansionFactor = hts / ots;
cursors = (hashBvNode***)alloca(expansionFactor * sizeof(void*));
goto more_data;
}
}
-
-indexType HbvNext(hashBv* bv, Compiler* comp)
-{
- if (bv)
- {
- bv->globalData()->hashBvNextIterator.initFrom(bv);
- }
- return bv->globalData()->hashBvNextIterator.nextBit();
-}
public:
hashBv(Compiler* comp);
- hashBv(hashBv* other);
- // hashBv() {}
static hashBv* Create(Compiler* comp);
static void Init(Compiler* comp);
static hashBv* CreateFrom(hashBv* other, Compiler* comp);
// maintain free lists for vectors
hashBvNode** getNewVector(int vectorLength);
- void freeVector(hashBvNode* vect, int vectorLength);
int getNodeCount();
- hashBvNode* getFreeList();
-
public:
inline hashBvNode* getOrAddNodeForIndex(indexType index)
{
// --------------------------------------------------------------------
// --------------------------------------------------------------------
-class hbvFreeListNode
-{
-public:
- hbvFreeListNode* next;
- int size;
-};
-
-// --------------------------------------------------------------------
-// --------------------------------------------------------------------
-
class hashBvIterator
{
public:
friend class hashBv;
friend class hashBvNode;
- hashBvNode* hbvNodeFreeList;
- hashBv* hbvFreeList;
- unsigned short hbvHashSizeLog2;
- hbvFreeListNode* hbvFreeVectorList;
-
-public:
- hashBvIterator hashBvNextIterator;
+ hashBvNode* hbvNodeFreeList;
+ hashBv* hbvFreeList;
};
-indexType HbvNext(hashBv* bv, Compiler* comp);
-
// clang-format off
#define FOREACH_HBV_BIT_SET(index, bv) \
{ \