aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/unpacker.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-06-14 15:20:37 +0200
committerGitHub <noreply@github.com>2022-06-14 15:20:37 +0200
commit2a2fb8be74f9147773416be63334ea6a74c66869 (patch)
treeb0593d6a1f328862a3a131155be2f35a2feee941 /src/nvim/msgpack_rpc/unpacker.h
parentcd9e08cb94663558891fdd46dfa58f662e947be5 (diff)
parent3f5c647de97a424d8a06e85b912ed46cc3ca8298 (diff)
downloadrneovim-2a2fb8be74f9147773416be63334ea6a74c66869.tar.gz
rneovim-2a2fb8be74f9147773416be63334ea6a74c66869.tar.bz2
rneovim-2a2fb8be74f9147773416be63334ea6a74c66869.zip
Merge pull request #18880 from bfredl/arena
perf(memory): use an arena for RPC decoding
Diffstat (limited to 'src/nvim/msgpack_rpc/unpacker.h')
-rw-r--r--src/nvim/msgpack_rpc/unpacker.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/msgpack_rpc/unpacker.h b/src/nvim/msgpack_rpc/unpacker.h
index bbd6b1ef4f..e0dc6f0a68 100644
--- a/src/nvim/msgpack_rpc/unpacker.h
+++ b/src/nvim/msgpack_rpc/unpacker.h
@@ -9,8 +9,10 @@
#include "mpack/object.h"
#include "nvim/api/private/dispatch.h"
#include "nvim/api/private/helpers.h"
+#include "nvim/memory.h"
+#include "nvim/msgpack_rpc/channel_defs.h"
-typedef struct {
+struct Unpacker {
mpack_parser_t parser;
mpack_tokbuf_t reader;
@@ -28,7 +30,11 @@ typedef struct {
Object error; // error return
Object result; // arg list or result
Error unpack_error;
-} Unpacker;
+
+ Arena arena;
+ // one lenght free-list of reusable blocks
+ ArenaMem reuse_blk;
+};
// unrecovareble error. unpack_error should be set!
#define unpacker_closed(p) ((p)->state < 0)