0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -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

@@ -417,7 +417,6 @@ may_do_incsearch_highlighting(
int found; // do_search() result
pos_T end_pos;
#ifdef FEAT_RELTIME
proftime_T tm;
searchit_arg_T sia;
#endif
int next_char;
@@ -484,10 +483,6 @@ may_do_incsearch_highlighting(
cursor_off(); // so the user knows we're busy
out_flush();
++emsg_off; // so it doesn't beep if bad expr
#ifdef FEAT_RELTIME
// Set the time limit to half a second.
profile_setlimit(500L, &tm);
#endif
if (!p_hls)
search_flags += SEARCH_KEEP;
if (search_first_line != 0)
@@ -495,7 +490,8 @@ may_do_incsearch_highlighting(
ccline.cmdbuff[skiplen + patlen] = NUL;
#ifdef FEAT_RELTIME
CLEAR_FIELD(sia);
sia.sa_tm = &tm;
// Set the time limit to half a second.
sia.sa_tm = 500;
#endif
found = do_search(NULL, firstc == ':' ? '/' : firstc, search_delim,
ccline.cmdbuff + skiplen, count, search_flags,