]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas hash.h tidy
authorAlan Modra <amodra@gmail.com>
Thu, 7 Jul 2022 04:20:29 +0000 (13:50 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 9 Jul 2022 12:03:49 +0000 (21:33 +0930)
commit1309c3165cc0751f5c4657e0e0ac4335640f2f03
tree835eb0d8b192f8ff27c4b8ff03c51602faf7ac5d
parented2917de68fe1ae3f279cef3b48c6464c75e9d72
gas hash.h tidy

Only inline functions should be defined in hash.h, there's no benefit
in having multiple copies of hash_string_tuple and eq_string_tuple.
Also, use the table alloc_f when allocating tuples to be stored, so
that these functions are usable with different memory allocation
strategies.

* hash.h (struct string_tuple, string_tuple_t): Move earlier.
(string_tuple_alloc): Add table param, allocate using table alloc_f.
(str_hash_insert): Adjust to suit.  Call table->free_f when
entry is not used.
(hash_string_tuple, eq_string_tuple): Move to..
* hash.c: ..here.
gas/hash.c
gas/hash.h