summaryrefslogtreecommitdiff
path: root/include/mysql/psi/mysql_memory.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-02-15 18:25:57 +0100
committerSergei Golubchik <serg@mariadb.org>2020-03-10 19:24:23 +0100
commit7af733a5a2cb7f79ffb5ff0129cad6db6f3cc359 (patch)
treef8f9cab2cd92e43b5fd20c9ac77f9487ece4e5a7 /include/mysql/psi/mysql_memory.h
parent81cffda2e68ea5a155b74f24ae4345388afa963c (diff)
downloadmariadb-git-7af733a5a2cb7f79ffb5ff0129cad6db6f3cc359.tar.gz
perfschema compilation, test and misc fixes
Diffstat (limited to 'include/mysql/psi/mysql_memory.h')
-rw-r--r--include/mysql/psi/mysql_memory.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h
index c491ef4570c..a79579c2e56 100644
--- a/include/mysql/psi/mysql_memory.h
+++ b/include/mysql/psi/mysql_memory.h
@@ -30,6 +30,18 @@
#include "mysql/psi/psi.h"
+#ifdef HAVE_PSI_MEMORY_INTERFACE
+#define PSI_CALL_memory_alloc(A1,A2,A3) PSI_MEMORY_CALL(memory_alloc)(A1,A2,A3)
+#define PSI_CALL_memory_free(A1,A2,A3) PSI_MEMORY_CALL(memory_free)(A1,A2,A3)
+#define PSI_CALL_memory_realloc(A1,A2,A3,A4) PSI_MEMORY_CALL(memory_realloc)(A1,A2,A3,A4)
+#define PSI_CALL_register_memory(A1,A2,A3) PSI_MEMORY_CALL(register_memory)(A1,A2,A3)
+#else
+#define PSI_CALL_memory_alloc(A1,A2,A3) 0
+#define PSI_CALL_memory_free(A1,A2,A3) do { } while(0)
+#define PSI_CALL_memory_realloc(A1,A2,A3,A4) 0
+#define PSI_CALL_register_memory(A1,A2,A3) do { } while(0)
+#endif
+
#ifndef PSI_MEMORY_CALL
#define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M)
#endif
@@ -58,9 +70,7 @@ static inline void inline_mysql_memory_register(
int count __attribute__((unused)))
#endif
{
-#ifdef HAVE_PSI_MEMORY_INTERFACE
- PSI_MEMORY_CALL(register_memory)(category, info, count);
-#endif
+ PSI_CALL_register_memory(category, info, count);
}
/** @} (end of group Memory_instrumentation) */