mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
perf(memory): use an arena for RPC decoding
drawback: tracing memory errors with ASAN is less accurate for arena allocated memory. Therefore, to start with it is being used for Object types around serialization/deserialization exclusively. This is going to have a large impact especially when TUI is refactored as a co-prosess as all UI events will be serialized and deserialized by nvim itself.
This commit is contained in:
@@ -1016,10 +1016,11 @@ static int nlua_rpc(lua_State *lstate, bool request)
|
||||
}
|
||||
|
||||
if (request) {
|
||||
Object result = rpc_send_call(chan_id, name, args, &err);
|
||||
ArenaMem res_mem = NULL;
|
||||
Object result = rpc_send_call(chan_id, name, args, &res_mem, &err);
|
||||
if (!ERROR_SET(&err)) {
|
||||
nlua_push_Object(lstate, result, false);
|
||||
api_free_object(result);
|
||||
arena_mem_free(res_mem, NULL);
|
||||
}
|
||||
} else {
|
||||
if (!rpc_send_event(chan_id, name, args)) {
|
||||
|
Reference in New Issue
Block a user