comparison src/eval.c @ 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 e7b4fff348dd
comparison
equal deleted inserted replaced
19190:1483c87623da 19191:133ef7ba4e4e
690 { 690 {
691 lp->ll_name = name; 691 lp->ll_name = name;
692 692
693 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9 && *p == ':') 693 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9 && *p == ':')
694 { 694 {
695 scriptitem_T *si = &SCRIPT_ITEM(current_sctx.sc_sid); 695 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
696 char_u *tp = skipwhite(p + 1); 696 char_u *tp = skipwhite(p + 1);
697 697
698 // parse the type after the name 698 // parse the type after the name
699 lp->ll_type = parse_type(&tp, &si->sn_type_list); 699 lp->ll_type = parse_type(&tp, &si->sn_type_list);
700 lp->ll_name_end = tp; 700 lp->ll_name_end = tp;