forked from Imagelibrary/binutils-gdb
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user