Add __pure2 to a few more functions, most notably gettid and pthread_self.
Change-Id: I7eee9f26f45130038af09d8285782b07f70a996f
This commit is contained in:
@@ -30,11 +30,14 @@ static void BM_unistd_getpid(int iters) {
|
||||
}
|
||||
BENCHMARK(BM_unistd_getpid);
|
||||
|
||||
// Stop GCC optimizing out our pure function.
|
||||
/* Must not be static! */ pid_t (*gettid_fp)() = gettid;
|
||||
|
||||
static void BM_unistd_gettid(int iters) {
|
||||
StartBenchmarkTiming();
|
||||
|
||||
for (int i = 0; i < iters; ++i) {
|
||||
gettid();
|
||||
gettid_fp();
|
||||
}
|
||||
|
||||
StopBenchmarkTiming();
|
||||
|
Reference in New Issue
Block a user