Fix the rdtscp detection bug and add prefix for the macro.
This commit is contained in:
parent
8b64be3441
commit
31e01a98f1
@ -522,10 +522,10 @@ typedef unsigned __int32 uint32_t;
|
|||||||
return 0;
|
return 0;
|
||||||
]])],
|
]])],
|
||||||
[je_cv_rdtscp=yes],
|
[je_cv_rdtscp=yes],
|
||||||
[je_cv_rdstcp=no],
|
[je_cv_rdtscp=no],
|
||||||
[je_cv_rdtscp=no]))
|
[je_cv_rdtscp=no]))
|
||||||
if test "x${je_cv_rdtscp}" = "xyes"; then
|
if test "x${je_cv_rdtscp}" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_RDTSCP], 1, [])
|
AC_DEFINE([JEMALLOC_HAVE_RDTSCP], [ ], [ ])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -443,4 +443,10 @@
|
|||||||
/* If defined, use volatile asm during benchmarks. */
|
/* If defined, use volatile asm during benchmarks. */
|
||||||
#undef JEMALLOC_HAVE_ASM_VOLATILE
|
#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_ */
|
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */
|
||||||
|
@ -14,7 +14,7 @@ malloc_getcpu(void) {
|
|||||||
return GetCurrentProcessorNumber();
|
return GetCurrentProcessorNumber();
|
||||||
#elif defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
#elif defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
||||||
return (malloc_cpuid_t)sched_getcpu();
|
return (malloc_cpuid_t)sched_getcpu();
|
||||||
#elif defined(HAVE_RDTSCP)
|
#elif defined(JEMALLOC_HAVE_RDTSCP)
|
||||||
unsigned int ax, cx, dx;
|
unsigned int ax, cx, dx;
|
||||||
asm volatile("rdtscp" : "=a"(ax), "=d"(dx), "=c"(cx) ::);
|
asm volatile("rdtscp" : "=a"(ax), "=d"(dx), "=c"(cx) ::);
|
||||||
return (malloc_cpuid_t)(dx & 0xfff);
|
return (malloc_cpuid_t)(dx & 0xfff);
|
||||||
|
Loading…
Reference in New Issue
Block a user