refactor(map): remove extra-allocating map_new/map_free functions

Note: the reason for removing them is not that there after this refactor
is no use of them, but rather that having them available is an
anti-pattern: they manange an _extra_ heap allocation which has
nothing to do with the functionality of the map itself (khash
manages the real buffers internally). In case there happens to
be a reason to allocate the map structure itself later, this
should be made explicit using xcalloc/xfree calls.
This commit is contained in:
Björn Linse
2021-08-22 16:03:21 +02:00
parent db1b0ee3b3
commit de21e6ef3d
16 changed files with 69 additions and 99 deletions

View File

@@ -321,8 +321,6 @@ end
output:write([[
void msgpack_rpc_init_method_table(void)
{
methods = map_new(String, MsgpackRpcRequestHandler)();
]])
for i = 1, #functions do