aboutsummaryrefslogtreecommitdiff
path: root/include/axolotl/memory.hh
blob: 7749c54537301807086bc993d2453aba326fe7f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <cstddef>

namespace axolotl {

/** Clear the memory held in the buffer */
void unset(
    volatile void * buffer, std::size_t buffer_length
);

/** Clear the memory backing an object */
template<typename T>
void unset(T & value) {
    unset(reinterpret_cast<volatile void *>(&value), sizeof(T));
}


} // namespace axolotl