summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2021-03-23 18:16:20 +1100
committerDaniel Black <daniel@mariadb.org>2021-03-26 07:58:49 +1100
commitbcb9ca41053aa3db8d4d04d9d11dcd176b1a23e9 (patch)
treef99837b5dfaf1dd0b40ebda05739ba73e4381bfc /storage/innobase
parente731a283942c3ec2386d79b639317131645caa1e (diff)
downloadmariadb-git-bcb9ca41053aa3db8d4d04d9d11dcd176b1a23e9.tar.gz
MEM_CHECK_DEFINED: replace HAVE_valgrindbb-10.5-danielblack-clang-valgrind-without-memcheck_h
HAVE_valgrind_or_MSAN to HAVE_valgrind was incorrect in af784385b4a2b286000fa2c658e34283fe7bba60. In my_valgrind.h when clang exists (hence no __has_feature(memory_sanitizer), and -DWITH_VALGRIND=1, but without memcheck.h, we end up with a MEM_CHECK_DEFINED being empty. If we are also doing a CMAKE_BUILD_TYPE=Debug this results a number of [-Werror,-Wunused-variable] errors because MEM_CHECK_DEFINED is empty. With MEM_CHECK_DEFINED empty, there becomes no uses of this of the fixed field and innodb variables in this patch. So we stop using HAVE_valgrind as catchall and use the name HAVE_CHECK_MEM to indicate that a CHECK_MEM_DEFINED function exists. Reviewer: Monty Corrects: af784385b4a2b286000fa2c658e34283fe7bba60
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/include/srv0mon.h6
-rw-r--r--storage/innobase/page/page0cur.cc8
2 files changed, 7 insertions, 7 deletions
diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h
index 20365ffc7a7..77a90b0c84a 100644
--- a/storage/innobase/include/srv0mon.h
+++ b/storage/innobase/include/srv0mon.h
@@ -637,14 +637,14 @@ Use MONITOR_DEC if appropriate mutex protection exists.
} \
}
-#ifdef HAVE_valgrind
+#ifdef HAVE_MEM_CHECK
# define MONITOR_CHECK_DEFINED(value) do { \
mon_type_t m = value; \
MEM_CHECK_DEFINED(&m, sizeof m); \
} while (0)
-#else /* HAVE_valgrind */
+#else /* HAVE_MEM_CHECK */
# define MONITOR_CHECK_DEFINED(value) (void) 0
-#endif /* HAVE_valgrind */
+#endif /* HAVE_MEM_CHECK */
#define MONITOR_INC_VALUE(monitor, value) \
MONITOR_CHECK_DEFINED(value); \
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index cb4293f998a..5e751010f44 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -1311,7 +1311,7 @@ page_cur_insert_rec_low(
/* 1. Get the size of the physical record in the page */
const ulint rec_size= rec_offs_size(offsets);
-#ifdef HAVE_valgrind
+#ifdef HAVE_MEM_CHECK
{
const void *rec_start= rec - rec_offs_extra_size(offsets);
ulint extra_size= rec_offs_extra_size(offsets) -
@@ -1323,7 +1323,7 @@ page_cur_insert_rec_low(
/* The variable-length header must be valid. */
MEM_CHECK_DEFINED(rec_start, extra_size);
}
-#endif /* HAVE_valgrind */
+#endif /* HAVE_MEM_CHECK */
/* 2. Try to find suitable space from page memory management */
bool reuse= false;
@@ -1717,7 +1717,7 @@ page_cur_insert_rec_zip(
/* 1. Get the size of the physical record in the page */
const ulint rec_size= rec_offs_size(offsets);
-#ifdef HAVE_valgrind
+#ifdef HAVE_MEM_CHECK
{
const void *rec_start= rec - rec_offs_extra_size(offsets);
ulint extra_size= rec_offs_extra_size(offsets) - REC_N_NEW_EXTRA_BYTES;
@@ -1726,7 +1726,7 @@ page_cur_insert_rec_zip(
/* The variable-length header must be valid. */
MEM_CHECK_DEFINED(rec_start, extra_size);
}
-#endif /* HAVE_valgrind */
+#endif /* HAVE_MEM_CHECK */
const bool reorg_before_insert= page_has_garbage(cursor->block->frame) &&
rec_size > page_get_max_insert_size(cursor->block->frame, 1) &&
rec_size <= page_get_max_insert_size_after_reorganize(cursor->block->frame,