aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-06-02 09:18:13 +0200
committerbfredl <bjorn.linse@gmail.com>2022-06-14 14:33:04 +0200
commit3f5c647de97a424d8a06e85b912ed46cc3ca8298 (patch)
treeee1eb2d7db29f903f86684cae28107eb2c835b7e /src/nvim/tui
parent7f8f8d6cb7874369c36553cd8cc500de1b572b31 (diff)
downloadrneovim-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/tui')
-rw-r--r--src/nvim/tui/input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index c8083cddb1..3e24e892b8 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -144,8 +144,10 @@ static void tinput_wait_enqueue(void **argv)
Error err = ERROR_INIT;
ADD(args, STRING_OBJ(copy_string(keys)));
// TODO(bfredl): could be non-blocking now with paste?
- Object result = rpc_send_call(ui_client_channel_id, "nvim_input", args, &err);
+ ArenaMem res_mem = NULL;
+ Object result = rpc_send_call(ui_client_channel_id, "nvim_input", args, &res_mem, &err);
consumed = result.type == kObjectTypeInteger ? (size_t)result.data.integer : 0;
+ arena_mem_free(res_mem, NULL);
} else {
consumed = input_enqueue(keys);
}