From 3f5c647de97a424d8a06e85b912ed46cc3ca8298 Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 2 Jun 2022 09:18:13 +0200 Subject: 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. --- src/nvim/eval/funcs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index fc8c9ef445..25f80758d2 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -7893,7 +7893,8 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) uint64_t chan_id = (uint64_t)argvars[0].vval.v_number; const char *method = tv_get_string(&argvars[1]); - Object result = rpc_send_call(chan_id, method, args, &err); + ArenaMem res_mem = NULL; + Object result = rpc_send_call(chan_id, method, args, &res_mem, &err); if (l_provider_call_nesting) { current_sctx = save_current_sctx; @@ -7928,7 +7929,7 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) } end: - api_free_object(result); + arena_mem_free(res_mem, NULL); api_clear_error(&err); } -- cgit