24#ifndef PFS_STD_ALLOCATOR_H
25#define PFS_STD_ALLOCATOR_H
49 if (
n > std::numeric_limits<std::size_t>::max() /
sizeof(T))
50 throw std::bad_array_new_length();
52 const size_t size =
n *
sizeof(T);
55 throw std::bad_alloc();
57 return static_cast<T *
>(
mem);
61 const size_t size =
n *
sizeof(T);
71template <
class T,
class U>
76template <
class T,
class U>
const char * p
Definition: ctype-mb.cc:1235
Header for compiler-dependent features.
Some integer typedefs for easier portability.
#define MYF(v)
Definition: my_inttypes.h:97
size_t size(const char *const c)
Definition: base64.h:46
void * pfs_malloc(PFS_builtin_memory_class *klass, size_t size, myf flags)
Memory allocation for the performance schema.
Definition: pfs_global.cc:61
void pfs_free(PFS_builtin_memory_class *klass, size_t size, void *ptr)
Free memory allocated with.
Definition: pfs_global.cc:108
Miscellaneous global dependencies (declarations).
bool operator==(const PFS_std_allocator< T > &t, const PFS_std_allocator< U > &u)
Definition: pfs_std_allocator.h:72
bool operator!=(const PFS_std_allocator< T > &t, const PFS_std_allocator< U > &u)
Definition: pfs_std_allocator.h:77
static MEM_ROOT mem
Definition: sql_servers.cc:100
Definition: pfs_builtin_memory.h:39
Definition: pfs_std_allocator.h:38
PFS_builtin_memory_class * m_klass
Definition: pfs_std_allocator.h:68
PFS_std_allocator(PFS_builtin_memory_class *klass)
Definition: pfs_std_allocator.h:42
void deallocate(T *p, std::size_t n) noexcept
Definition: pfs_std_allocator.h:60
T value_type
Definition: pfs_std_allocator.h:40
PFS_builtin_memory_class * get_class() const
Definition: pfs_std_allocator.h:65
T * allocate(std::size_t n)
Definition: pfs_std_allocator.h:48
constexpr PFS_std_allocator(const PFS_std_allocator< U > &u) noexcept
Definition: pfs_std_allocator.h:45
int n
Definition: xcom_base.cc:509