return (HASH_MAGIC * hashcode(key)) >> (32 - h->lgalloced);
}
-static struct HashRec* realloc(struct naHash* hash)
+static struct HashRec* hashrealloc(struct naHash* hash)
{
struct HashRec *h, *h0 = hash->rec;
int lga, cols, need = h0 ? h0->size - h0->dels : MIN_HASH_SIZE;
int col;
struct HashRec* h = hash->rec;
while(!h || h->size >= 1<<h->lgalloced)
- h = realloc(hash);
+ h = hashrealloc(hash);
col = (HASH_MAGIC * sym->ref.ptr.str->hashcode) >> (32 - h->lgalloced);
INSERT(h, *sym, *val, col);
}
if((n = find(hash.ref.ptr.hash, key))) { n->val = val; return; }
h = hash.ref.ptr.hash->rec;
while(!h || h->size >= 1<<h->lgalloced)
- h = realloc(hash.ref.ptr.hash);
+ h = hashrealloc(hash.ref.ptr.hash);
col = hashcolumn(h, key);
INSERT(h, key, val, hashcolumn(h, key));
chkcycle(h->table[col], h->size - h->dels);
return vr;
}
-static void realloc(struct naVec* v)
+static void vecrealloc(struct naVec* v)
{
struct VecRec* vr = newvecrec(v->rec);
naGC_swapfree((void**)&(v->rec), vr);
if(IS_VEC(vec)) {
struct VecRec* r = vec.ref.ptr.vec->rec;
while(!r || r->size >= r->alloced) {
- realloc(vec.ref.ptr.vec);
+ vecrealloc(vec.ref.ptr.vec);
r = vec.ref.ptr.vec->rec;
}
r->array[r->size] = o;
o = v->array[v->size - 1];
v->size--;
if(v->size < (v->alloced >> 1))
- realloc(vec.ref.ptr.vec);
+ vecrealloc(vec.ref.ptr.vec);
return o;
}
return naNil();