0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.5057: using gettimeofday() for timeout is very inefficient

Problem:    Using gettimeofday() for timeout is very inefficient.
Solution:   Set a platform dependent timer. (Paul Ollis, closes #10505)
This commit is contained in:
Paul Ollis
2022-06-05 16:55:54 +01:00
committed by Bram Moolenaar
parent 1d97db3d98
commit 6574577cac
29 changed files with 811 additions and 242 deletions

View File

@@ -1474,9 +1474,6 @@ win_update(win_T *wp)
#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA)
int save_got_int;
#endif
#ifdef SYN_TIME_LIMIT
proftime_T syntax_tm;
#endif
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
// This needs to be done only for the first window when update_screen() is
@@ -2182,8 +2179,7 @@ win_update(win_T *wp)
#endif
#ifdef SYN_TIME_LIMIT
// Set the time limit to 'redrawtime'.
profile_setlimit(p_rdt, &syntax_tm);
syn_set_timeout(&syntax_tm);
init_regexp_timeout(p_rdt);
#endif
#ifdef FEAT_FOLDING
win_foldinfo.fi_level = 0;
@@ -2695,7 +2691,7 @@ win_update(win_T *wp)
}
#ifdef SYN_TIME_LIMIT
syn_set_timeout(NULL);
disable_regexp_timeout();
#endif
// Reset the type of redrawing required, the window has been updated.