Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/mysql/server
File: my_valgrind.h
/* Copyright (C) 2010, 2022, MariaDB Corporation.
[0] Fix | Delete
[1] Fix | Delete
This program is free software; you can redistribute it and/or modify
[2] Fix | Delete
it under the terms of the GNU General Public License as published by
[3] Fix | Delete
the Free Software Foundation; version 2 of the License.
[4] Fix | Delete
[5] Fix | Delete
This program is distributed in the hope that it will be useful,
[6] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[7] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[8] Fix | Delete
GNU General Public License for more details.
[9] Fix | Delete
[10] Fix | Delete
You should have received a copy of the GNU General Public License
[11] Fix | Delete
along with this program; if not, write to the Free Software
[12] Fix | Delete
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
[13] Fix | Delete
[14] Fix | Delete
#ifndef MY_VALGRIND_INCLUDED
[15] Fix | Delete
#define MY_VALGRIND_INCLUDED
[16] Fix | Delete
[17] Fix | Delete
/* clang -> gcc */
[18] Fix | Delete
#ifndef __has_feature
[19] Fix | Delete
# define __has_feature(x) 0
[20] Fix | Delete
#endif
[21] Fix | Delete
#if __has_feature(address_sanitizer)
[22] Fix | Delete
# define __SANITIZE_ADDRESS__ 1
[23] Fix | Delete
#endif
[24] Fix | Delete
[25] Fix | Delete
#if __has_feature(memory_sanitizer)
[26] Fix | Delete
# include <sanitizer/msan_interface.h>
[27] Fix | Delete
# define HAVE_valgrind
[28] Fix | Delete
# define HAVE_MEM_CHECK
[29] Fix | Delete
# define MEM_UNDEFINED(a,len) __msan_allocated_memory(a,len)
[30] Fix | Delete
# define MEM_MAKE_ADDRESSABLE(a,len) MEM_UNDEFINED(a,len)
[31] Fix | Delete
# define MEM_MAKE_DEFINED(a,len) __msan_unpoison(a,len)
[32] Fix | Delete
# define MEM_NOACCESS(a,len) ((void) 0)
[33] Fix | Delete
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
[34] Fix | Delete
# define MEM_CHECK_DEFINED(a,len) __msan_check_mem_is_initialized(a,len)
[35] Fix | Delete
# define MEM_GET_VBITS(a,b,len) __msan_copy_shadow(b,a,len)
[36] Fix | Delete
# define MEM_SET_VBITS(a,b,len) __msan_copy_shadow(a,b,len)
[37] Fix | Delete
# define REDZONE_SIZE 8
[38] Fix | Delete
# ifdef __linux__
[39] Fix | Delete
# define MSAN_STAT_WORKAROUND(st) MEM_MAKE_DEFINED(st, sizeof(*st))
[40] Fix | Delete
# else
[41] Fix | Delete
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
[42] Fix | Delete
# endif
[43] Fix | Delete
#elif defined(HAVE_VALGRIND_MEMCHECK_H) && defined(HAVE_valgrind)
[44] Fix | Delete
# include <valgrind/memcheck.h>
[45] Fix | Delete
# define HAVE_MEM_CHECK
[46] Fix | Delete
# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
[47] Fix | Delete
# define MEM_MAKE_ADDRESSABLE(a,len) MEM_UNDEFINED(a,len)
[48] Fix | Delete
# define MEM_MAKE_DEFINED(a,len) VALGRIND_MAKE_MEM_DEFINED(a,len)
[49] Fix | Delete
# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
[50] Fix | Delete
# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
[51] Fix | Delete
# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
[52] Fix | Delete
# define MEM_GET_VBITS(a,b,len) VALGRIND_GET_VBITS(a,b,len)
[53] Fix | Delete
# define MEM_SET_VBITS(a,b,len) VALGRIND_SET_VBITS(a,b,len)
[54] Fix | Delete
# define REDZONE_SIZE 8
[55] Fix | Delete
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
[56] Fix | Delete
#elif defined(__SANITIZE_ADDRESS__) && (!defined(_MSC_VER) || defined (__clang__))
[57] Fix | Delete
# include <sanitizer/asan_interface.h>
[58] Fix | Delete
/* How to do manual poisoning:
[59] Fix | Delete
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
[60] Fix | Delete
# define MEM_UNDEFINED(a,len) ((void) 0)
[61] Fix | Delete
# define MEM_MAKE_ADDRESSABLE(a,len) ASAN_UNPOISON_MEMORY_REGION(a,len)
[62] Fix | Delete
# define MEM_MAKE_DEFINED(a,len) ((void) 0)
[63] Fix | Delete
# define MEM_NOACCESS(a,len) ASAN_POISON_MEMORY_REGION(a,len)
[64] Fix | Delete
# define MEM_CHECK_ADDRESSABLE(a,len) \
[65] Fix | Delete
assert(!__asan_region_is_poisoned((void*) a,len))
[66] Fix | Delete
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
[67] Fix | Delete
# define MEM_GET_VBITS(a,b,len) ((void) 0)
[68] Fix | Delete
# define MEM_SET_VBITS(a,b,len) ((void) 0)
[69] Fix | Delete
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
[70] Fix | Delete
# define REDZONE_SIZE 8
[71] Fix | Delete
#else
[72] Fix | Delete
# define MEM_UNDEFINED(a,len) ((void) 0)
[73] Fix | Delete
# define MEM_MAKE_ADDRESSABLE(a,len) ((void) 0)
[74] Fix | Delete
# define MEM_MAKE_DEFINED(a,len) ((void) 0)
[75] Fix | Delete
# define MEM_NOACCESS(a,len) ((void) 0)
[76] Fix | Delete
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
[77] Fix | Delete
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
[78] Fix | Delete
# define MEM_GET_VBITS(a,b,len) ((void) 0)
[79] Fix | Delete
# define MEM_SET_VBITS(a,b,len) ((void) 0)
[80] Fix | Delete
# define REDZONE_SIZE 0
[81] Fix | Delete
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
[82] Fix | Delete
#endif /* __has_feature(memory_sanitizer) */
[83] Fix | Delete
[84] Fix | Delete
#ifdef TRASH_FREED_MEMORY
[85] Fix | Delete
/*
[86] Fix | Delete
_TRASH_FILL() has to call MEM_MAKE_ADDRESSABLE() to cancel any effect of
[87] Fix | Delete
TRASH_FREE().
[88] Fix | Delete
This can happen in the case one does
[89] Fix | Delete
TRASH_ALLOC(A,B) ; TRASH_FREE(A,B) ; TRASH_ALLOC(A,B)
[90] Fix | Delete
to reuse the same memory in an internal memory allocator like MEM_ROOT.
[91] Fix | Delete
_TRASH_FILL() is an internal function and should not be used externally.
[92] Fix | Delete
*/
[93] Fix | Delete
#define _TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_MAKE_ADDRESSABLE(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
[94] Fix | Delete
#else
[95] Fix | Delete
#define _TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
[96] Fix | Delete
#endif
[97] Fix | Delete
/** Note that some memory became allocated and/or uninitialized. */
[98] Fix | Delete
#define TRASH_ALLOC(A,B) do { _TRASH_FILL(A,B,0xA5); MEM_MAKE_ADDRESSABLE(A,B); } while(0)
[99] Fix | Delete
/** Note that some memory became freed. (Prohibit further access to it.) */
[100] Fix | Delete
#define TRASH_FREE(A,B) do { _TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
[101] Fix | Delete
[102] Fix | Delete
#endif /* MY_VALGRIND_INCLUDED */
[103] Fix | Delete
[104] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function