aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/dispatch.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-08-24 15:22:30 +0200
committerGitHub <noreply@github.com>2022-08-24 15:22:30 +0200
commitf1ea126a6eb1d9cae53eae3fedbfa51f90ee97b1 (patch)
treeb0c3c27869110cc51cda2f18d64ef9608c956481 /src/nvim/api/private/dispatch.h
parentf91b1885ddeaf971e17afe49b80f1b1412ecc8a2 (diff)
parent7784dc9e0d90284b0d9c9cf0833c27d4de22b7f4 (diff)
downloadrneovim-f1ea126a6eb1d9cae53eae3fedbfa51f90ee97b1.tar.gz
rneovim-f1ea126a6eb1d9cae53eae3fedbfa51f90ee97b1.tar.bz2
rneovim-f1ea126a6eb1d9cae53eae3fedbfa51f90ee97b1.zip
Merge pull request #19906 from bfredl/bigstage
perf(api): allow to use an arena for return values
Diffstat (limited to 'src/nvim/api/private/dispatch.h')
-rw-r--r--src/nvim/api/private/dispatch.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h
index 4b7c394944..f92b205531 100644
--- a/src/nvim/api/private/dispatch.h
+++ b/src/nvim/api/private/dispatch.h
@@ -5,18 +5,23 @@
typedef Object (*ApiDispatchWrapper)(uint64_t channel_id,
Array args,
+ Arena *arena,
Error *error);
/// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores
/// functions of this type.
-typedef struct {
+struct MsgpackRpcRequestHandler {
const char *name;
ApiDispatchWrapper fn;
bool fast; // Function is safe to be executed immediately while running the
// uv loop (the loop is run very frequently due to breakcheck).
// If "fast" is false, the function is deferred, i e the call will
// be put in the event queue, for safe handling later.
-} MsgpackRpcRequestHandler;
+ bool arena_return; // return value is allocated in the arena (or statically)
+ // and should not be freed as such.
+};
+
+extern const MsgpackRpcRequestHandler method_handlers[];
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/private/dispatch.h.generated.h"