Fix the rdtscp detection bug and add prefix for the macro.
This commit is contained in:
@@ -443,4 +443,10 @@
|
||||
/* If defined, use volatile asm during benchmarks. */
|
||||
#undef JEMALLOC_HAVE_ASM_VOLATILE
|
||||
|
||||
/*
|
||||
* If defined, support the use of rdtscp to get the time stamp counter
|
||||
* and the processor ID.
|
||||
*/
|
||||
#undef JEMALLOC_HAVE_RDTSCP
|
||||
|
||||
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */
|
||||
|
@@ -14,7 +14,7 @@ malloc_getcpu(void) {
|
||||
return GetCurrentProcessorNumber();
|
||||
#elif defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
||||
return (malloc_cpuid_t)sched_getcpu();
|
||||
#elif defined(HAVE_RDTSCP)
|
||||
#elif defined(JEMALLOC_HAVE_RDTSCP)
|
||||
unsigned int ax, cx, dx;
|
||||
asm volatile("rdtscp" : "=a"(ax), "=d"(dx), "=c"(cx) ::);
|
||||
return (malloc_cpuid_t)(dx & 0xfff);
|
||||
|
Reference in New Issue
Block a user