6 #ifndef JSON_ALLOCATOR_H_INCLUDED
7 #define JSON_ALLOCATOR_H_INCLUDED
33 return static_cast<pointer>(::operator
new(n *
sizeof(T)));
44 #if defined(HAVE_MEMSET_S)
45 memset_s(p, n *
sizeof(T), 0, n *
sizeof(T));
47 RtlSecureZeroMemory(p, n *
sizeof(T));
49 std::fill_n(reinterpret_cast<volatile unsigned char*>(p), n, 0);
61 ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
81 template <
typename U>
struct rebind {
86 template <
typename T,
typename U>
91 template <
typename T,
typename U>
100 #endif // JSON_ALLOCATOR_H_INCLUDED
void construct(pointer p, Args &&...args)
Construct an item in-place at pointer P.
pointer address(reference x) const
const T & const_reference
void deallocate(pointer p, size_type n)
Release memory which was allocated for N items at pointer P.
const_pointer address(const_reference x) const
pointer allocate(size_type n)
Allocate memory for N items using the standard allocator.
SecureAllocator(const SecureAllocator< U > &)
void destroy(pointer p)
Destroy an item in-place at pointer P.
JSON (JavaScript Object Notation).
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
size_type max_size() const
std::ptrdiff_t difference_type
bool operator!=(const SecureAllocator< T > &, const SecureAllocator< U > &)