mirror of
https://github.com/gperftools/gperftools
synced 2025-01-18 04:41:34 +00:00
force profiler_unittest to do 'real' work
'XOR loop' in profiler unittest wasn't 100% effective because it allowed compiler to avoid loading and storing to memory. After marking result variable as volatile, we're now forcing compiler to read and write memory, slowing this loops down sufficiently. And profiler_unittest is now passing more consistently. Closes #628
This commit is contained in:
parent
fff6b4fb88
commit
728cbe1021
@ -46,7 +46,7 @@
|
||||
#include "base/simple_mutex.h"
|
||||
#include "tests/testutil.h"
|
||||
|
||||
static int result = 0;
|
||||
static volatile int result = 0;
|
||||
static int g_iters = 0; // argv[1]
|
||||
|
||||
Mutex mutex(Mutex::LINKER_INITIALIZED);
|
||||
|
Loading…
Reference in New Issue
Block a user