diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-26 13:39:05 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-26 14:02:12 -0300 |
commit | 4bac5e9ce19afd4647ee4d313c9485229d05a334 (patch) | |
tree | 5f6927bb13c8e68c6572c6d5d004c4517338cbfb /src/nvim/api/private/defs.h | |
parent | 339d106f7c1e756782980e884304b44e5faebddd (diff) | |
download | rneovim-4bac5e9ce19afd4647ee4d313c9485229d05a334.tar.gz rneovim-4bac5e9ce19afd4647ee4d313c9485229d05a334.tar.bz2 rneovim-4bac5e9ce19afd4647ee4d313c9485229d05a334.zip |
API: Refactor: Duplicate/free string arguments coming from msgpack
When receiving strings *from* msgpack, we don't need to duplicate/free since
the data only lives in the msgpack parse buffer until the end of the call.
But in order to reuse `msgpack_rpc_free_object` when sending event data(which is
sent *to* msgpack), Strings must be freed, which means they must also be
allocated separately.
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r-- | src/nvim/api/private/defs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index a91907f4f8..4d9f5fb708 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -6,6 +6,7 @@ #include <string.h> #define ARRAY_DICT_INIT {.size = 0, .items = NULL} +#define STRING_INIT {.data = NULL, .size = 0} #define REMOTE_TYPE(type) typedef uint64_t type #define TYPED_ARRAY_OF(type) \ |