diff options
| author | bfredl <bjorn.linse@gmail.com> | 2022-08-23 10:36:46 +0200 |
|---|---|---|
| committer | bfredl <bjorn.linse@gmail.com> | 2022-08-24 14:22:26 +0200 |
| commit | bcf5ee328e228d5a536b4de2069a79234f9f3e9e (patch) | |
| tree | ce25e8627bb00363deb6919561400fa1807ebf47 /src/nvim/generators | |
| parent | c0d60526541a3cf977ae623471ae4a347b492af1 (diff) | |
| download | rneovim-bcf5ee328e228d5a536b4de2069a79234f9f3e9e.tar.gz rneovim-bcf5ee328e228d5a536b4de2069a79234f9f3e9e.tar.bz2 rneovim-bcf5ee328e228d5a536b4de2069a79234f9f3e9e.zip | |
refactor(arena): use a shared block freelist
This is both simpler in client code and more effective (always reuse
block hottest in cache)
Diffstat (limited to 'src/nvim/generators')
| -rw-r--r-- | src/nvim/generators/gen_api_dispatch.lua | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index e4798bf5ce..67b8f5f0f5 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -413,8 +413,6 @@ output:write([[ #include "nvim/lua/executor.h" #include "nvim/memory.h" -static ArenaMem lua_reuse_blk = { 0 }; - ]]) include_headers(output, headers) output:write('\n') @@ -496,7 +494,6 @@ local function process_function(fn) cparams = cparams .. '&arena, ' write_shifted_output(output, [[ Arena arena = ARENA_EMPTY; - arena_start(&arena, &lua_reuse_blk); ]]) end @@ -536,7 +533,7 @@ local function process_function(fn) end local free_retval if fn.arena_return then - free_retval = "arena_mem_free(arena_finish(&arena), &lua_reuse_blk);" + free_retval = "arena_mem_free(arena_finish(&arena));" else free_retval = "api_free_"..return_type:lower().."(ret);" end |