prevent confusion by not using a standard name.
This commit is contained in:
parent
8f9921d00c
commit
a807e66d4a
@ -49,7 +49,7 @@ static unsigned int hashcolumn(struct HashRec* h, naRef key)
|
|||||||
return (HASH_MAGIC * hashcode(key)) >> (32 - h->lgalloced);
|
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;
|
struct HashRec *h, *h0 = hash->rec;
|
||||||
int lga, cols, need = h0 ? h0->size - h0->dels : MIN_HASH_SIZE;
|
int lga, cols, need = h0 ? h0->size - h0->dels : MIN_HASH_SIZE;
|
||||||
@ -171,7 +171,7 @@ void naHash_newsym(struct naHash* hash, naRef* sym, naRef* val)
|
|||||||
int col;
|
int col;
|
||||||
struct HashRec* h = hash->rec;
|
struct HashRec* h = hash->rec;
|
||||||
while(!h || h->size >= 1<<h->lgalloced)
|
while(!h || h->size >= 1<<h->lgalloced)
|
||||||
h = realloc(hash);
|
h = hashrealloc(hash);
|
||||||
col = (HASH_MAGIC * sym->ref.ptr.str->hashcode) >> (32 - h->lgalloced);
|
col = (HASH_MAGIC * sym->ref.ptr.str->hashcode) >> (32 - h->lgalloced);
|
||||||
INSERT(h, *sym, *val, col);
|
INSERT(h, *sym, *val, col);
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ void naHash_set(naRef hash, naRef key, naRef val)
|
|||||||
if((n = find(hash.ref.ptr.hash, key))) { n->val = val; return; }
|
if((n = find(hash.ref.ptr.hash, key))) { n->val = val; return; }
|
||||||
h = hash.ref.ptr.hash->rec;
|
h = hash.ref.ptr.hash->rec;
|
||||||
while(!h || h->size >= 1<<h->lgalloced)
|
while(!h || h->size >= 1<<h->lgalloced)
|
||||||
h = realloc(hash.ref.ptr.hash);
|
h = hashrealloc(hash.ref.ptr.hash);
|
||||||
col = hashcolumn(h, key);
|
col = hashcolumn(h, key);
|
||||||
INSERT(h, key, val, hashcolumn(h, key));
|
INSERT(h, key, val, hashcolumn(h, key));
|
||||||
chkcycle(h->table[col], h->size - h->dels);
|
chkcycle(h->table[col], h->size - h->dels);
|
||||||
|
@ -13,7 +13,7 @@ static struct VecRec* newvecrec(struct VecRec* old)
|
|||||||
return vr;
|
return vr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void realloc(struct naVec* v)
|
static void vecrealloc(struct naVec* v)
|
||||||
{
|
{
|
||||||
struct VecRec* vr = newvecrec(v->rec);
|
struct VecRec* vr = newvecrec(v->rec);
|
||||||
naGC_swapfree((void**)&(v->rec), vr);
|
naGC_swapfree((void**)&(v->rec), vr);
|
||||||
@ -60,7 +60,7 @@ int naVec_append(naRef vec, naRef o)
|
|||||||
if(IS_VEC(vec)) {
|
if(IS_VEC(vec)) {
|
||||||
struct VecRec* r = vec.ref.ptr.vec->rec;
|
struct VecRec* r = vec.ref.ptr.vec->rec;
|
||||||
while(!r || r->size >= r->alloced) {
|
while(!r || r->size >= r->alloced) {
|
||||||
realloc(vec.ref.ptr.vec);
|
vecrealloc(vec.ref.ptr.vec);
|
||||||
r = vec.ref.ptr.vec->rec;
|
r = vec.ref.ptr.vec->rec;
|
||||||
}
|
}
|
||||||
r->array[r->size] = o;
|
r->array[r->size] = o;
|
||||||
@ -91,7 +91,7 @@ naRef naVec_removelast(naRef vec)
|
|||||||
o = v->array[v->size - 1];
|
o = v->array[v->size - 1];
|
||||||
v->size--;
|
v->size--;
|
||||||
if(v->size < (v->alloced >> 1))
|
if(v->size < (v->alloced >> 1))
|
||||||
realloc(vec.ref.ptr.vec);
|
vecrealloc(vec.ref.ptr.vec);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
return naNil();
|
return naNil();
|
||||||
|
Loading…
Reference in New Issue
Block a user