178 |
if (size < 4) |
if (size < 4) |
179 |
size = 4; |
size = 4; |
180 |
h->size = next_power_of_2 (size); |
h->size = next_power_of_2 (size); |
181 |
h->entries = xmalloc (sizeof *h->entries * h->size); |
h->entries = xnmalloc (h->size, sizeof *h->entries); |
182 |
for (i = 0; i < h->size; i++) |
for (i = 0; i < h->size; i++) |
183 |
h->entries[i] = NULL; |
h->entries[i] = NULL; |
184 |
h->aux = aux; |
h->aux = aux; |
268 |
end = begin + h->size; |
end = begin + h->size; |
269 |
|
|
270 |
h->size = new_size; |
h->size = new_size; |
271 |
h->entries = xmalloc (sizeof *h->entries * h->size); |
h->entries = xnmalloc (h->size, sizeof *h->entries); |
272 |
for (i = 0; i < h->size; i++) |
for (i = 0; i < h->size; i++) |
273 |
h->entries[i] = NULL; |
h->entries[i] = NULL; |
274 |
for (table_p = begin; table_p < end; table_p++) |
for (table_p = begin; table_p < end; table_p++) |
385 |
void **copy; |
void **copy; |
386 |
|
|
387 |
assert (h != NULL); |
assert (h != NULL); |
388 |
copy = xmalloc ((h->used + 1) * sizeof *copy); |
copy = xnmalloc ((h->used + 1), sizeof *copy); |
389 |
copy_if (h->entries, h->size, sizeof *h->entries, copy, not_null, NULL); |
copy_if (h->entries, h->size, sizeof *h->entries, copy, not_null, NULL); |
390 |
copy[h->used] = NULL; |
copy[h->used] = NULL; |
391 |
return copy; |
return copy; |