+ void *data = cursor->data;
+ struct hash_entry *new_bucket
+ = new_table->bucket + new_table->hasher (data, new_n_buckets);
+
+ assert (new_bucket < new_table->bucket_limit);
+
+ /* Free overflow entries as soon as possible, moving them from the
+ old hash table into the new one, as they may be needed now. */
+ next = cursor->next;
+ if (cursor != bucket)
+ free_entry (new_table, cursor);
+
+ /* Insert the entry into the new hash table. */
+ if (new_bucket->data)
+ {
+ struct hash_entry *new_entry = allocate_entry (new_table);
+
+ if (new_entry == NULL)
+ return false;
+
+ new_entry->data = data;
+ new_entry->next = new_bucket->next;
+ new_bucket->next = new_entry;
+ }
+ else
+ {
+ new_bucket->data = data;
+ new_table->n_buckets_used++;
+ }