Mercurial > vim
comparison src/globals.h @ 19191:133ef7ba4e4e v8.2.0154
patch 8.2.0154: reallocating the list of scripts is inefficient
Commit: https://github.com/vim/vim/commit/21b9e9773d64de40994f8762173bdd8befa6acf7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 26 19:26:46 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Jan 2020 19:30:14 +0100 |
parents | 94eda51ba9ba |
children | c53dbbf3229b |
comparison
equal
deleted
inserted
replaced
19190:1483c87623da | 19191:133ef7ba4e4e |
---|---|
283 EXTERN int debug_tick INIT(= 0); // breakpoint change count | 283 EXTERN int debug_tick INIT(= 0); // breakpoint change count |
284 EXTERN int debug_backtrace_level INIT(= 0); // breakpoint backtrace level | 284 EXTERN int debug_backtrace_level INIT(= 0); // breakpoint backtrace level |
285 # ifdef FEAT_PROFILE | 285 # ifdef FEAT_PROFILE |
286 EXTERN int do_profiling INIT(= PROF_NONE); // PROF_ values | 286 EXTERN int do_profiling INIT(= PROF_NONE); // PROF_ values |
287 # endif | 287 # endif |
288 EXTERN garray_T script_items INIT5(0, 0, sizeof(scriptitem_T), 4, NULL); | 288 EXTERN garray_T script_items INIT5(0, 0, sizeof(scriptitem_T *), 20, NULL); |
289 # define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1]) | 289 # define SCRIPT_ITEM(id) (((scriptitem_T **)script_items.ga_data)[(id) - 1]) |
290 # define SCRIPT_SV(id) (SCRIPT_ITEM(id).sn_vars) | 290 # define SCRIPT_SV(id) (SCRIPT_ITEM(id)->sn_vars) |
291 # define SCRIPT_VARS(id) (SCRIPT_SV(id)->sv_dict.dv_hashtab) | 291 # define SCRIPT_VARS(id) (SCRIPT_SV(id)->sv_dict.dv_hashtab) |
292 | 292 |
293 # define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] | 293 # define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] |
294 | 294 |
295 /* | 295 /* |