Lines Matching refs:tab

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