X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/83cd972a1a7f536a8be5c0e7504768c3fb7298f4..eeeb962b:/lib/hash.c diff --git a/lib/hash.c b/lib/hash.c index fdf56948..c066c639 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -46,7 +46,7 @@ hash_init (struct hash_table* ht, unsigned long size, ht->ht_size = round_up_2 (size); if (ht->ht_size > (128 * 1024)) /* prevent size from getting out of hand */ ht->ht_size /= 2; - ht->ht_vec = (void**) CALLOC (struct token *, ht->ht_size); + ht->ht_vec = (void**) XCALLOC (struct token *, ht->ht_size); if (ht->ht_vec == 0) error (1, 0, _("can't allocate %ld bytes for hash table: memory exhausted"), ht->ht_size * sizeof(struct token *)); @@ -228,7 +228,7 @@ hash_rehash (struct hash_table* ht) ht->ht_size *= 2; ht->ht_rehashes++; ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4); - ht->ht_vec = (void **) CALLOC (struct token *, ht->ht_size); + ht->ht_vec = (void **) XCALLOC (struct token *, ht->ht_size); for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++) { @@ -263,7 +263,7 @@ hash_dump (struct hash_table *ht, void **vector_0, qsort_cmp_t compare) void **end = &ht->ht_vec[ht->ht_size]; if (vector_0 == 0) - vector_0 = MALLOC (void *, ht->ht_fill + 1); + vector_0 = XMALLOC (void *, ht->ht_fill + 1); vector = vector_0; for (slot = ht->ht_vec; slot < end; slot++)