diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-02-25 15:02:48 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-03-07 09:39:46 +0100 |
commit | dc37c1550bed46fffbb677d343cdc5bc94056219 (patch) | |
tree | 86213752366e016637f9e155a975facb408decad /src/nvim/msgpack_rpc/helpers.h | |
parent | 6525832a8c4d44a8ebabba02a5ea1ce09b389a4f (diff) | |
download | rneovim-dc37c1550bed46fffbb677d343cdc5bc94056219.tar.gz rneovim-dc37c1550bed46fffbb677d343cdc5bc94056219.tar.bz2 rneovim-dc37c1550bed46fffbb677d343cdc5bc94056219.zip |
refactor(msgpack): allow flushing buffer while packing msgpack
Before, we needed to always pack an entire msgpack_rpc Object to
a continous memory buffer before sending it out to a channel.
But this is generally wasteful. it is better to just flush
whatever is in the buffer and then continue packing to a new buffer.
This is also done for the UI event packer where there are some extra logic
to "finish" of an existing batch of nevents/ncalls. This doesn't really
stop us from flushing the buffer, just that we need to update the state
machine accordingly so the next call to prepare_call() always will
start with a new event (even though the buffer might contain overflow
data from a large event).
Diffstat (limited to 'src/nvim/msgpack_rpc/helpers.h')
-rw-r--r-- | src/nvim/msgpack_rpc/helpers.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/nvim/msgpack_rpc/helpers.h b/src/nvim/msgpack_rpc/helpers.h deleted file mode 100644 index 6344d8c567..0000000000 --- a/src/nvim/msgpack_rpc/helpers.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include <msgpack.h> // IWYU pragma: keep - -#include "nvim/api/private/defs.h" - -/// Value by which objects represented as EXT type are shifted -/// -/// Subtracted when packing, added when unpacking. Used to allow moving -/// buffer/window/tabpage block inside ObjectType enum. This block yet cannot be -/// split or reordered. -#define EXT_OBJECT_TYPE_SHIFT kObjectTypeBuffer -#define EXT_OBJECT_TYPE_MAX (kObjectTypeTabpage - EXT_OBJECT_TYPE_SHIFT) - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "msgpack_rpc/helpers.h.generated.h" -#endif |