Use asm volatile during benchmarks.

This commit is contained in:
guangli-dai 2022-12-15 10:54:33 -08:00 committed by Qi Wang
parent e8b28908de
commit 09e4b38fb1
6 changed files with 51 additions and 7 deletions

View file

@ -9,6 +9,7 @@ large_mallocx_free(void) {
*/
void *p = mallocx(SC_LARGE_MINCLASS, MALLOCX_TCACHE_NONE);
assert_ptr_not_null(p, "mallocx shouldn't fail");
p = no_opt_ptr(p);
free(p);
}
@ -16,6 +17,7 @@ static void
small_mallocx_free(void) {
void *p = mallocx(16, 0);
assert_ptr_not_null(p, "mallocx shouldn't fail");
p = no_opt_ptr(p);
free(p);
}