diff options
author | lloyd <[email protected]> | 2014-08-09 15:56:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-08-09 15:56:32 +0000 |
commit | 455bd2557cbb1343e59eefd97cb449f06a702c28 (patch) | |
tree | 4bb7de20fb10e198b57768d3dabd31ed093a95e7 /src/lib/utils | |
parent | 28726b93b0b9ae221f54ab7cc297d09a9af6843a (diff) |
Have clear_mem just be a plain memset and only call the (slow)
zero_mem just before a deallocation where we are actually at risk of
the compiler eliding the writes.
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/mem_ops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/utils/mem_ops.h b/src/lib/utils/mem_ops.h index be617ff19..05b2c22a5 100644 --- a/src/lib/utils/mem_ops.h +++ b/src/lib/utils/mem_ops.h @@ -27,7 +27,7 @@ BOTAN_DLL void zero_mem(void* ptr, size_t n); */ template<typename T> inline void clear_mem(T* ptr, size_t n) { - zero_mem(ptr, sizeof(T)*n); + std::memset(ptr, 0, sizeof(T)*n); } /** |