diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-08-01 18:02:03 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-08-01 18:02:03 -0400 |
commit | 390d27b6cddcc82145352034354e5c0fa39ab821 (patch) | |
tree | 954aaecb5fd42239e4f17040aae469df78545fb9 /smartptr.h | |
parent | ad352c64e0d3467bf1bc67e89a7596acbc1576f8 (diff) | |
download | cryptopp-git-390d27b6cddcc82145352034354e5c0fa39ab821.tar.gz |
Hid inline assembly behind a macro
Diffstat (limited to 'smartptr.h')
-rw-r--r-- | smartptr.h | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -3,6 +3,7 @@ #include "config.h" #include "stdcpp.h" +#include "misc.h" #include "trap.h" NAMESPACE_BEGIN(CryptoPP) @@ -51,11 +52,8 @@ template <class T> simple_ptr<T>::~simple_ptr() delete m_p; m_p = NULL; -#ifdef __GNUC__ - // From Andrew Haley (GCC Dev), to tame the optimizer so the assignment is always performed. - // See "Disable optimizations in one function" on the GCC mailing list. - asm volatile ("" : : : "memory"); -#endif + // https://github.com/weidai11/cryptopp/issues/6 + MEMORY_BARRIER(); } template <class T> class member_ptr |