Commit 4b6a3518 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Use _ReadWriteBarrier() rather than MemoryBarrier() for preventing compile optimization

parent fd7a8d18
......@@ -100,7 +100,7 @@ struct ut_when_dtor {
#if defined (__GNUC__)
# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
#elif defined (_MSC_VER)
# define UT_COMPILER_BARRIER() MemoryBarrier()
# define UT_COMPILER_BARRIER() _ReadWriteBarrier()
#else
# define UT_COMPILER_BARRIER()
#endif
......
......@@ -97,7 +97,7 @@ struct ut_when_dtor {
#if defined (__GNUC__)
# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
#elif defined (_MSC_VER)
# define UT_COMPILER_BARRIER() MemoryBarrier()
# define UT_COMPILER_BARRIER() _ReadWriteBarrier()
#else
# define UT_COMPILER_BARRIER()
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment