20 template <
class T2, std::enable_if_t<std::is_convertible_v<T2*, T*>,
int> = 0>
23 void operator()(T* p)
const noexcept { _Unreferenced_(p); }
33 template <
class T2, std::enable_if_t<std::is_convertible_v<T2(*)[], T(*)[]>,
int> = 0>
36 template <
class T2, std::enable_if_t<std::is_convertible_v<T2(*)[], T(*)[]>,
int> = 0>
37 void operator()(T2* p)
const noexcept { p; }
49 std::shared_ptr<T> make_shared_no_delete(_In_ T* p)
56 #pragma warning(disable: 4100)
103 SecureZeroMemory(p,
sizeof(T) * n);
105 memset(p, 0,
sizeof(T) * n);
107 std::allocator<T>::deallocate(p, n);
128 SecureZeroMemory(
m_data, N);
An allocator template that sanitizes each memory block before it is destroyed or reallocated.
Definition memory.hpp:67
void deallocate(T *const p, const std::size_t n)
Deallocate object at p sanitizing its content first.
Definition memory.hpp:100
sanitizing_allocator() noexcept
Construct default allocator.
Definition memory.hpp:81
sanitizing_allocator(const sanitizing_allocator< T2 > &other) noexcept
Construct from a related allocator.
Definition memory.hpp:94
sanitizing_allocator(const sanitizing_allocator< T > &other)
Construct by copying.
Definition memory.hpp:87
Sanitizing BLOB.
Definition memory.hpp:118
unsigned char m_data[N]
BLOB data.
Definition memory.hpp:135
Noop deleter.
Definition memory.hpp:17
Convert this type to sanitizing_allocator<T2>
Definition memory.hpp:74
sanitizing_allocator< T2 > other
Other type.
Definition memory.hpp:75