32#ifndef detail_ut_allocator_traits_h
33#define detail_ut_allocator_traits_h
35#if defined(_WIN32) && defined(MYSQL_SERVER)
43#if defined(_WIN32) && defined(MYSQL_SERVER)
51inline void *
malloc(
size_t nbytes) {
52 std::call_once(mysys::detail::init_malloc_pointers_flag,
53 mysys::detail::init_malloc_pointers);
54 return mysys::detail::pfn_malloc(nbytes);
56inline void *
calloc(
size_t nbytes) {
57 std::call_once(mysys::detail::init_malloc_pointers_flag,
58 mysys::detail::init_malloc_pointers);
59 return mysys::detail::pfn_calloc(1, nbytes);
61inline void *
realloc(
void *ptr,
size_t nbytes) {
62 std::call_once(mysys::detail::init_malloc_pointers_flag,
63 mysys::detail::init_malloc_pointers);
64 return mysys::detail::pfn_realloc(ptr, nbytes);
66inline void free(
void *ptr) {
67 std::call_once(mysys::detail::init_malloc_pointers_flag,
68 mysys::detail::init_malloc_pointers);
69 mysys::detail::pfn_free(ptr);
74inline void *
realloc(
void *ptr,
size_t nbytes) {
81template <
bool Pfs_instrumented>
93 template <
bool Zero_initialized>
94 static void *
alloc(
size_t size) {
95 if constexpr (Zero_initialized)
101 static void *
realloc(
void *ptr,
size_t nbytes) {
Details for dynamically loading and using jemalloc.dll on Windows.
#define malloc(A)
Definition: lexyy.cc:914
#define realloc(P, A)
Definition: lexyy.cc:916
#define free(A)
Definition: lexyy.cc:915
Definition: ut0tuple.h:57
void * realloc(void *ptr, size_t nbytes)
Definition: allocator_traits.h:74
void * malloc(size_t nbytes)
Definition: allocator_traits.h:72
void free(void *ptr)
Definition: allocator_traits.h:77
void * calloc(size_t nbytes)
Definition: allocator_traits.h:73
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
Simple wrapping type around malloc, calloc and friends.
Definition: allocator_traits.h:88
static void * malloc(size_t nbytes)
Definition: allocator_traits.h:89
static void * alloc(size_t size)
Definition: allocator_traits.h:94
static void * calloc(size_t nbytes)
Definition: allocator_traits.h:91
static void free(void *ptr)
Definition: allocator_traits.h:105
static void * realloc(void *ptr, size_t nbytes)
Definition: allocator_traits.h:101
Simple allocator traits.
Definition: allocator_traits.h:82
static constexpr auto is_pfs_instrumented_v
Definition: allocator_traits.h:84