diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-08-03 14:01:31 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-08-03 14:01:31 -0400 |
commit | 8bfb29740f376df94f0f73d8aa06114a833f8c4c (patch) | |
tree | e83e322a663c333c92e6ae20282a55c24d7c6be2 /smartptr.h | |
parent | 69c6989e991da4c5980e7a6f4ac757340172ca34 (diff) | |
download | cryptopp-git-8bfb29740f376df94f0f73d8aa06114a833f8c4c.tar.gz |
Removed inline ASM for GCC. According to the GCC devs, the cast to volatile is all that's required
Diffstat (limited to 'smartptr.h')
-rw-r--r-- | smartptr.h | 13 |
1 files changed, 0 insertions, 13 deletions
@@ -34,15 +34,6 @@ template <class T> simple_ptr<T>::~simple_ptr() { delete m_p; *((volatile T**)(&m_p)) = 0; - - // Ensure the assignment is always performed. MSVC and Clang provide expected - // operational behavior for volatile. GCC has a more strict interpretation of - // the keyword (see http://www.airs.com/blog/archives/154), and volatile - // should not be used to tame the optimizer. However, inline assembly - // will tame it (see https://gcc.gnu.org/ml/gcc-help/2015-07/msg00053.html). -#ifdef __GNUC__ - asm volatile ("" : : : "memory"); -#endif } template <class T> class member_ptr @@ -66,10 +57,6 @@ public: T *old_p = m_p; *((volatile T**)(&m_p)) = 0; return old_p; - -#ifdef __GNUC__ - asm volatile ("" : : : "memory"); -#endif } void reset(T *p = 0); |