12#pragma GCC diagnostic push
13#pragma GCC diagnostic ignored "-Wunknown-pragmas"
25 template <
class T2, std::enable_if_t<std::is_convertible_v<T2*, T*>,
int> = 0>
28 void operator()(T* p)
const noexcept { _Unreferenced_(p); }
38 template <
class T2, std::enable_if_t<std::is_convertible_v<T2(*)[], T(*)[]>,
int> = 0>
41 template <
class T2, std::enable_if_t<std::is_convertible_v<T2(*)[], T(*)[]>,
int> = 0>
42 void operator()(T2* p)
const noexcept { p; }
54 std::shared_ptr<T> make_shared_no_delete(_In_ T* p)
61 #pragma warning(disable: 4100)
108 SecureZeroMemory(p,
sizeof(T) * n);
110 memset(p, 0,
sizeof(T) * n);
112 std::allocator<T>::deallocate(p, n);
133 SecureZeroMemory(
m_data, N);
145#pragma GCC diagnostic pop
An allocator template that sanitizes each memory block before it is destroyed or reallocated.
Definition memory.hpp:72
void deallocate(T *const p, const std::size_t n)
Deallocate object at p sanitizing its content first.
Definition memory.hpp:105
sanitizing_allocator() noexcept
Construct default allocator.
Definition memory.hpp:86
sanitizing_allocator(const sanitizing_allocator< T2 > &other) noexcept
Construct from a related allocator.
Definition memory.hpp:99
sanitizing_allocator(const sanitizing_allocator< T > &other)
Construct by copying.
Definition memory.hpp:92
Sanitizing BLOB.
Definition memory.hpp:123
unsigned char m_data[N]
BLOB data.
Definition memory.hpp:140
Noop deleter.
Definition memory.hpp:22
Convert this type to sanitizing_allocator<T2>
Definition memory.hpp:79
sanitizing_allocator< T2 > other
Other type.
Definition memory.hpp:80