aboutsummaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
Diffstat (limited to 'src/support')
-rw-r--r--src/support/cleanse.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/support/cleanse.cpp b/src/support/cleanse.cpp
index 17a4a4c2b2..f895e96568 100644
--- a/src/support/cleanse.cpp
+++ b/src/support/cleanse.cpp
@@ -30,14 +30,14 @@
*/
void memory_cleanse(void *ptr, size_t len)
{
+#if defined(_MSC_VER)
+ SecureZeroMemory(ptr, len);
+#else
std::memset(ptr, 0, len);
/* As best as we can tell, this is sufficient to break any optimisations that
might try to eliminate "superfluous" memsets. If there's an easy way to
detect memset_s, it would be better to use that. */
-#if defined(_MSC_VER)
- SecureZeroMemory(ptr, len);
-#else
__asm__ __volatile__("" : : "r"(ptr) : "memory");
#endif
}