diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-06-02 09:18:13 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-06-14 14:33:04 +0200 |
commit | 3f5c647de97a424d8a06e85b912ed46cc3ca8298 (patch) | |
tree | ee1eb2d7db29f903f86684cae28107eb2c835b7e /src/nvim/lua/executor.c | |
parent | 7f8f8d6cb7874369c36553cd8cc500de1b572b31 (diff) | |
download | rneovim-3f5c647de97a424d8a06e85b912ed46cc3ca8298.tar.gz rneovim-3f5c647de97a424d8a06e85b912ed46cc3ca8298.tar.bz2 rneovim-3f5c647de97a424d8a06e85b912ed46cc3ca8298.zip |
perf(memory): use an arena for RPC decoding
drawback: tracing memory errors with ASAN is less accurate for arena
allocated memory.
Therefore, to start with it is being used for Object types around
serialization/deserialization exclusively. This is going to have
a large impact especially when TUI is refactored as a co-prosess
as all UI events will be serialized and deserialized by nvim itself.
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index bd06123d5f..215aae9430 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1016,10 +1016,11 @@ static int nlua_rpc(lua_State *lstate, bool request) } if (request) { - Object result = rpc_send_call(chan_id, name, args, &err); + ArenaMem res_mem = NULL; + Object result = rpc_send_call(chan_id, name, args, &res_mem, &err); if (!ERROR_SET(&err)) { nlua_push_Object(lstate, result, false); - api_free_object(result); + arena_mem_free(res_mem, NULL); } } else { if (!rpc_send_event(chan_id, name, args)) { |