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