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)
diff --git a/src/structs.h b/src/structs.h
index a367d05..4666d02 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -3329,9 +3329,6 @@
// matchaddpos(). TRUE/FALSE
char has_cursor; // TRUE if the cursor is inside the match, used for
// CurSearch
-#ifdef FEAT_RELTIME
- proftime_T tm; // for a time limit
-#endif
} match_T;
// number of positions supported by matchaddpos()
@@ -4419,7 +4416,7 @@
{
linenr_T sa_stop_lnum; // stop after this line number when != 0
#ifdef FEAT_RELTIME
- proftime_T *sa_tm; // timeout limit or NULL
+ long sa_tm; // timeout limit or zero
int sa_timed_out; // set when timed out
#endif
int sa_wrapped; // search wrapped around