#ifndef ptable
typedef struct ptable {
ptable_ent **ary;
- UV max;
- UV items;
+ size_t max;
+ size_t items;
} ptable;
#define ptable ptable
#endif /* !ptable */
STATIC ptable *ptable_new(pPTBLMS) {
#define ptable_new() ptable_new(aPTBLMS)
ptable *t = PerlMemShared_malloc(sizeof *t);
- t->max = 127;
+ t->max = 15;
t->items = 0;
t->ary = PerlMemShared_calloc(t->max + 1, sizeof *t->ary);
return t;
STATIC void ptable_split(pPTBLMS_ ptable * const t) {
#define ptable_split(T) ptable_split(aPTBLMS_ (T))
ptable_ent **ary = t->ary;
- const UV oldsize = t->max + 1;
- UV newsize = oldsize * 2;
- UV i;
+ const size_t oldsize = t->max + 1;
+ size_t newsize = oldsize * 2;
+ size_t i;
ary = PerlMemShared_realloc(ary, newsize * sizeof(*ary));
Zero(&ary[oldsize], newsize - oldsize, sizeof(*ary));
PTABLE_VAL_FREE(oldval);
ent->val = val;
} else if (val) {
- const UV i = PTABLE_HASH(key) & t->max;
+ const size_t i = PTABLE_HASH(key) & t->max;
ent = PerlMemShared_malloc(sizeof *ent);
ent->key = key;
ent->val = val;
#define ptable_walk(T, CB, UD) ptable_walk(aTHX_ (T), (CB), (UD))
if (t && t->items) {
register ptable_ent ** const array = t->ary;
- UV i = t->max;
+ size_t i = t->max;
do {
ptable_ent *entry;
for (entry = array[i]; entry; entry = entry->next)
STATIC void PTABLE_PREFIX(_clear)(pPTBL_ ptable * const t) {
if (t && t->items) {
register ptable_ent ** const array = t->ary;
- UV i = t->max;
+ size_t i = t->max;
do {
ptable_ent *entry = array[i];