19 #include "my_global.h"
20 #include "my_compiler.h"
32 #if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) || defined(HAVE_ALIGNED_MALLOC)
33 #define PFS_ALIGNEMENT 64
34 #define PFS_ALIGNED MY_ALIGNED(PFS_ALIGNEMENT)
52 #define PFS_MALLOC_ARRAY(n, T, f) \
53 reinterpret_cast<T*> (pfs_malloc((n) * sizeof(T), (f)))
62 const struct sockaddr_storage *src_addr,
76 register intptr value;
78 if (unlikely(max_size == 0))
106 value= (
reinterpret_cast<intptr
> (ptr)) >> 3;
108 value+= seed2 + seed1 + 1;
110 result= (
static_cast<uint
> (value)) % max_size;
115 DBUG_ASSERT(result < max_size);
119 void pfs_print_error(
const char *format, ...);
126 #define SANITIZE_ARRAY_BODY(T, ARRAY, MAX, UNSAFE) \
128 if ((&ARRAY[0] <= UNSAFE) && \
129 (UNSAFE < &ARRAY[MAX])) \
131 offset= ((intptr) UNSAFE - (intptr) ARRAY) % sizeof(T); \