From b9d8fba1f5714d3ba7372721dc1aff2d5413e37c Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Thu, 30 Jun 2016 18:21:53 -0700 Subject: [PATCH] Use asm_volatile_memory() for portable memory barriors in LifoSemTests Summary: The portability headers exist for a reason, so use them. Reviewed By: yfeldblum Differential Revision: D3507031 fbshipit-source-id: f88c8ed37e648d38231c1d923c1d69d551beabff --- folly/test/LifoSemTests.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/folly/test/LifoSemTests.cpp b/folly/test/LifoSemTests.cpp index d06f2e09..09234c9e 100644 --- a/folly/test/LifoSemTests.cpp +++ b/folly/test/LifoSemTests.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -319,7 +320,7 @@ BENCHMARK(single_thread_lifo_post, iters) { LifoSem sem; for (size_t n = 0; n < iters; ++n) { sem.post(); - asm volatile ("":::"memory"); + asm_volatile_memory(); } } @@ -327,7 +328,7 @@ BENCHMARK(single_thread_lifo_wait, iters) { LifoSem sem(iters); for (size_t n = 0; n < iters; ++n) { sem.wait(); - asm volatile ("":::"memory"); + asm_volatile_memory(); } } @@ -335,9 +336,9 @@ BENCHMARK(single_thread_lifo_postwait, iters) { LifoSem sem; for (size_t n = 0; n < iters; ++n) { sem.post(); - asm volatile ("":::"memory"); + asm_volatile_memory(); sem.wait(); - asm volatile ("":::"memory"); + asm_volatile_memory(); } } @@ -345,7 +346,7 @@ BENCHMARK(single_thread_lifo_trywait, iters) { LifoSem sem; for (size_t n = 0; n < iters; ++n) { EXPECT_FALSE(sem.tryWait()); - asm volatile ("":::"memory"); + asm_volatile_memory(); } } -- 2.34.1