void free_format_hash_table (gfc_unit *u) { size_t i; /* free_format_data handles any NULL pointers. */ for (i = 0; i < FORMAT_HASH_SIZE; i++) { if (u->format_hash_table[i].hashed_fmt != NULL) { free_format_data (u->format_hash_table[i].hashed_fmt); free (u->format_hash_table[i].key); } u->format_hash_table[i].key = NULL; u->format_hash_table[i].key_len = 0; u->format_hash_table[i].hashed_fmt = NULL; } }
static void save_parsed_format (st_parameter_dt *dtp) { uint32_t hash; gfc_unit *u; hash = format_hash (dtp); u = dtp->u.p.current_unit; /* Index into the hash table. We are simply replacing whatever is there relying on probability. */ if (u->format_hash_table[hash].hashed_fmt != NULL) free_format_data (u->format_hash_table[hash].hashed_fmt); u->format_hash_table[hash].hashed_fmt = NULL; free (u->format_hash_table[hash].key); u->format_hash_table[hash].key = dtp->format; u->format_hash_table[hash].key_len = dtp->format_len; u->format_hash_table[hash].hashed_fmt = dtp->u.p.fmt; }