unsigned long i;
h = (t_hash) malloc(sizeof(struct hashStr));
- h->SIZE_HASH = (unsigned long) (OCUP_HASH * sizeVoc);
- h->SIZE_HASH = NearestPrime(h->SIZE_HASH);
+ unsigned long m = 6 * sizeVoc;
+ h->SIZE_HASH = sizeVoc;
+ do {
+ h->SIZE_HASH = NearestPrime(h->SIZE_HASH);
+ } while (h->SIZE_HASH >= m);
+
h->hash = (t_hashNode *) malloc(h->SIZE_HASH * sizeof(t_hashNode));
h->NumElem = 0;
if(h->NumElem >= h->SIZE_HASH/2)
{
-
resize(h);
-
}
//h->hash[*addr].word = (unsigned char*) malloc((len+1) * sizeof(unsigned char));
getMemoryBlock(h->_memMgr,( byte **)&(h->hash[*addr].word),len+1);