diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-01-03 15:24:41 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-01-03 17:31:54 +0100 |
commit | b2295ac4ec80e141628cea33ebee81c96e168989 (patch) | |
tree | ee197c75d19b1922d9a1149f8b5e1b7a12a76c70 /src/nvim/msgpack_rpc/channel.c | |
parent | 5b22b32e50858b781eb2658ba099eaffaa5ea13b (diff) | |
download | rneovim-b2295ac4ec80e141628cea33ebee81c96e168989.tar.gz rneovim-b2295ac4ec80e141628cea33ebee81c96e168989.tar.bz2 rneovim-b2295ac4ec80e141628cea33ebee81c96e168989.zip |
refactor(api): do not allocate temporaries for internal events
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r-- | src/nvim/msgpack_rpc/channel.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 4d011dc079..5b8e330e15 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -136,6 +136,7 @@ Object rpc_send_call(uint64_t id, const char *method_name, Array args, ArenaMem uint32_t request_id = rpc->next_request_id++; // Send the msgpack-rpc request send_request(channel, request_id, method_name, args); + api_free_array(args); // Push the frame ChannelCallFrame frame = { request_id, false, false, NIL, NULL }; @@ -491,7 +492,6 @@ static void broadcast_event(const char *name, Array args) }); if (!kv_size(subscribed)) { - api_free_array(args); goto end; } @@ -593,7 +593,6 @@ static WBuffer *serialize_request(uint64_t channel_id, uint32_t request_id, cons refcount, xfree); msgpack_sbuffer_clear(sbuffer); - api_free_array(args); return rv; } |