Lines Matching refs:tab
43 register Hash_table_t* tab;
65 if (!(tab = (Hash_table_t*)(*region)(handle, NiL, sizeof(Hash_table_t), 0)))
67 memset(tab, 0, sizeof(Hash_table_t));
69 else if (!(tab = newof(0, Hash_table_t, 1, 0)))
71 tab->bucketsize = (sizeof(Hash_header_t) + sizeof(char*) - 1) / sizeof(char*);
74 tab->flags = ref->flags & ~HASH_RESET;
75 tab->root = ref->root;
82 if (!(tab->root = (Hash_root_t*)(*region)(handle, NiL, sizeof(Hash_root_t), 0)))
84 memset(tab->root, 0, sizeof(Hash_root_t));
86 else if (!(tab->root = newof(0, Hash_root_t, 1, 0)))
88 if (!(tab->root->local = newof(0, Hash_local_t, 1, 0)))
90 if (tab->root->local->region = region)
91 tab->root->local->handle = handle;
92 tab->root->meanchain = HASHMEANCHAIN;
95 tab->size = HASHMINSIZE;
102 tab->root->local->alloc = va_arg(ap, Hash_alloc_f);
107 if (n > tab->bucketsize) tab->bucketsize = n;
110 tab->flags &= ~(va_arg(ap, int) & ~internal);
114 tab->root->local->compare = va_arg(ap, Hash_compare_f);
118 tab->root->local->free = va_arg(ap, Hash_free_f);
122 tab->root->local->hash = va_arg(ap, Hash_hash_f);
126 tab->root->meanchain = va_arg(ap, int);
129 tab->name = va_arg(ap, char*);
133 tab->root->namesize = va_arg(ap, int);
138 tab->flags |= (va_arg(ap, int) & ~internal);
141 tab->size = va_arg(ap, int);
142 if (tab->size & (tab->size - 1)) tab->flags |= HASH_FIXED;
145 tab->table = va_arg(ap, Hash_bucket_t**);
146 tab->flags |= HASH_STATIC;
163 if (tab->flags & HASH_SCOPE)
165 if (!(tab->scope = ref)) goto out;
168 if (!tab->table)
172 if (!(tab->table = (Hash_bucket_t**)(*region)(handle, NiL, sizeof(Hash_bucket_t*) * tab->size, 0)))
174 memset(tab->table, 0, sizeof(Hash_bucket_t*) * tab->size);
176 else if (!(tab->table = newof(0, Hash_bucket_t*, tab->size, 0))) goto out;
180 tab->root->flags = tab->flags & HASH_INTERNAL;
181 tab->root->next = hash_info.list;
182 hash_info.list = tab->root;
186 tab->next = tab->root->references;
187 tab->root->references = tab;
189 ret = tab;
198 if (!ret) hashfree(tab);