Remove hashtab_obstack_allocate

I think that hashtabs should never be obstack-allocated.  In the past
this was convenient sometimes, because any new data structure needed a
corresponding cleanup.  However, with the switch to C++, resource
management has become much simpler; for example, a local variable can
simply be of type htab_up rather than hashtab_t, and the problem is
solved.

This patch removes hashtab_obstack_allocate to try to prevent this
anti-pattern from being used again.
This commit is contained in:
Tom Tromey
2024-06-05 09:51:08 -06:00
parent 4122e647d5
commit 9f71296fda
4 changed files with 1 additions and 53 deletions

View File

@@ -42,9 +42,4 @@ htab_delete_entry (void *ptr)
delete (T *) ptr;
}
/* Allocation and deallocation functions for the libiberty hash table
which use obstacks. */
void *hashtab_obstack_allocate (void *data, size_t size, size_t count);
void dummy_obstack_deallocate (void *object, void *data);
#endif /* GDBSUPPORT_GDB_HASHTAB_H */