mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
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).
This commit is contained in:
@@ -2173,7 +2173,7 @@ String arena_printf(Arena *arena, const char *fmt, ...)
|
||||
char *buf = NULL;
|
||||
if (arena) {
|
||||
if (!arena->cur_blk) {
|
||||
alloc_block(arena);
|
||||
arena_alloc_block(arena);
|
||||
}
|
||||
|
||||
// happy case, we can fit the printed string in the rest of the current
|
||||
|
Reference in New Issue
Block a user