mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
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.
21b9e9773d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -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 *);
|
||||
|
Reference in New Issue
Block a user