diff options
| author | bfredl <bjorn.linse@gmail.com> | 2023-01-03 18:57:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-03 18:57:55 +0100 |
| commit | eb702273c4e862305c72b2b9354f7c3a32447135 (patch) | |
| tree | 1fa22dc5adf583318a17ff1abf1cb82bdcf1ce34 /src/nvim/msgpack_rpc | |
| parent | 1b3c255f608a6c1a4a31bcd4a640ea6696403341 (diff) | |
| parent | b2295ac4ec80e141628cea33ebee81c96e168989 (diff) | |
| download | rneovim-eb702273c4e862305c72b2b9354f7c3a32447135.tar.gz rneovim-eb702273c4e862305c72b2b9354f7c3a32447135.tar.bz2 rneovim-eb702273c4e862305c72b2b9354f7c3a32447135.zip | |
Merge pull request #21631 from bfredl/request_memory
refactor(api): do not allocate temporaries for internal events
Diffstat (limited to 'src/nvim/msgpack_rpc')
| -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; } |