mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-14 17:06:22 +03:00
Use asm volatile during benchmarks.
This commit is contained in:
parent
e8b28908de
commit
09e4b38fb1
6 changed files with 51 additions and 7 deletions
|
|
@ -58,3 +58,14 @@ compare_funcs(uint64_t nwarmup, uint64_t niter, const char *name_a,
|
|||
|
||||
dallocx(p, 0);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
no_opt_ptr(void *ptr) {
|
||||
#ifdef JEMALLOC_HAVE_ASM_VOLATILE
|
||||
asm volatile("" : "+r"(ptr));
|
||||
#else
|
||||
void *volatile dup = ptr;
|
||||
ptr = dup;
|
||||
#endif
|
||||
return ptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue