diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-15 17:09:20 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-15 17:23:08 +0300 |
commit | ff66d65a096ec02dda1ab449d84a40361551085c (patch) | |
tree | 62758be70a0df31bc0c376f948ef1dba3cc58b7b /include | |
parent | 1cac6d48282459d8855c1cec1eeb4bc0e3db5f89 (diff) | |
download | mariadb-git-ff66d65a096ec02dda1ab449d84a40361551085c.tar.gz |
Amend af784385b4a2b286000fa2c658e34283fe7bba60: Avoid vtable overhead
When neither MSAN nor Valgrind are enabled, declare
Field::mark_unused_memory_as_defined() as an empty inline function,
instead of declaring it as a virtual function.
Diffstat (limited to 'include')
-rw-r--r-- | include/my_valgrind.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/my_valgrind.h b/include/my_valgrind.h index 3cd4210dc3b..dc0c9bcfad4 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010, 2019, MariaDB Corporation. +/* Copyright (C) 2010, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #if defined(HAVE_VALGRIND_MEMCHECK_H) && defined(HAVE_valgrind) # include <valgrind/memcheck.h> +# define HAVE_valgrind_or_MSAN # define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) # define MEM_MAKE_DEFINED(a,len) VALGRIND_MAKE_MEM_DEFINED(a,len) # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) @@ -50,6 +51,7 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */ # define REDZONE_SIZE 8 #elif __has_feature(memory_sanitizer) # include <sanitizer/msan_interface.h> +# define HAVE_valgrind_or_MSAN # define MEM_UNDEFINED(a,len) __msan_allocated_memory(a,len) # define MEM_MAKE_DEFINED(a,len) __msan_unpoison(a,len) # define MEM_NOACCESS(a,len) ((void) 0) |