Assign match result to volatile in benchmarks
This is needed to avoid the compiler eliding the call in highly-optimised builds.
This commit is contained in:
parent
97529fdd2b
commit
4131af3912
@ -31,9 +31,11 @@ static void matching_benchmark(const fsa_t *fsa)
|
|||||||
for (int j = 0; j < LEN; ++j)
|
for (int j = 0; j < LEN; ++j)
|
||||||
s[j] = CLAMP_CHAR(rand());
|
s[j] = CLAMP_CHAR(rand());
|
||||||
|
|
||||||
|
volatile bool match;
|
||||||
START_CLOCK();
|
START_CLOCK();
|
||||||
fsa_accepts(fsa, s, LEN);
|
match = fsa_accepts(fsa, s, LEN);
|
||||||
STOP_CLOCK();
|
STOP_CLOCK();
|
||||||
|
(void)match;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user