mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
refactor(api): use a unpacker based on libmpack instead of msgpack-c
Currently this is more or less a straight off reimplementation, but this allow further optimizations down the line, especially for avoiding memory allocations of rpc objects. Current score for "make functionaltest; make oldtest" on a -DEXITFREE build: is 117 055 352 xfree(ptr != NULL) calls (that's NUMBERWANG!).
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/msgpack_rpc/channel.h"
|
||||
#include "nvim/msgpack_rpc/helpers.h"
|
||||
#include "nvim/msgpack_rpc/unpacker.h"
|
||||
#include "nvim/ops.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/os/input.h"
|
||||
@@ -2188,6 +2189,12 @@ void nvim__screenshot(String path)
|
||||
ui_call_screenshot(path);
|
||||
}
|
||||
|
||||
Object nvim__unpack(String str, Error *err)
|
||||
FUNC_API_FAST
|
||||
{
|
||||
return unpack(str.data, str.size, err);
|
||||
}
|
||||
|
||||
/// Deletes an uppercase/file named mark. See |mark-motions|.
|
||||
///
|
||||
/// @note fails with error if a lowercase or buffer local named mark is used.
|
||||
|
Reference in New Issue
Block a user