diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-16 11:00:48 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-02-16 11:50:28 +0800 |
commit | 0cbbe27e93e87a5336673e0529b011313c51a123 (patch) | |
tree | 1a5a45358dc499a7b620c0b6b0887aafd98c8f3f /src/nvim/runtime.h | |
parent | e619fb1660595f9e6a0afad8d9a91e37a94f95a3 (diff) | |
download | rneovim-0cbbe27e93e87a5336673e0529b011313c51a123.tar.gz rneovim-0cbbe27e93e87a5336673e0529b011313c51a123.tar.bz2 rneovim-0cbbe27e93e87a5336673e0529b011313c51a123.zip |
vim-patch:8.2.0154: reallocating the list of scripts is inefficient
Problem: Reallocating the list of scripts is inefficient.
Solution: Instead of using a growarray of scriptitem_T, store pointers and
allocate each scriptitem_T separately. Also avoids that the
growarray pointers change when sourcing a new script.
https://github.com/vim/vim/commit/21b9e9773d64de40994f8762173bdd8befa6acf7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/runtime.h')
-rw-r--r-- | src/nvim/runtime.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h index 0812355716..9a810298f8 100644 --- a/src/nvim/runtime.h +++ b/src/nvim/runtime.h @@ -87,7 +87,7 @@ typedef struct { /// Growarray to store info about already sourced scripts. extern garray_T script_items; -#define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1]) +#define SCRIPT_ITEM(id) (((scriptitem_T **)script_items.ga_data)[(id) - 1]) #define SCRIPT_ID_VALID(id) ((id) > 0 && (id) <= script_items.ga_len) typedef void (*DoInRuntimepathCB)(char *, void *); |