summaryrefslogtreecommitdiff
path: root/smartptr.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-08-01 18:02:03 -0400
committerJeffrey Walton <noloader@gmail.com>2015-08-01 18:02:03 -0400
commit390d27b6cddcc82145352034354e5c0fa39ab821 (patch)
tree954aaecb5fd42239e4f17040aae469df78545fb9 /smartptr.h
parentad352c64e0d3467bf1bc67e89a7596acbc1576f8 (diff)
downloadcryptopp-git-390d27b6cddcc82145352034354e5c0fa39ab821.tar.gz
Hid inline assembly behind a macro
Diffstat (limited to 'smartptr.h')
-rw-r--r--smartptr.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/smartptr.h b/smartptr.h
index 057f5213..db5441fe 100644
--- a/smartptr.h
+++ b/smartptr.h
@@ -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