diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-19 19:22:00 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-19 19:22:00 +0200 |
commit | ff979674e689266590672268692d85275a323e18 (patch) | |
tree | ab7becd376adda341b65a1a43a96f78eec7a541c /include | |
parent | 9007ca68738cb11b24854aa1bfa12dcd204a459d (diff) | |
parent | fafdac3365f4943e73bcefd0e0d07d69997a9724 (diff) | |
download | mariadb-git-ff979674e689266590672268692d85275a323e18.tar.gz |
Merge tag 'mariadb-5.5.59' into 5.5-galera
Diffstat (limited to 'include')
-rw-r--r-- | include/my_compare.h | 24 | ||||
-rw-r--r-- | include/my_sys.h | 4 | ||||
-rw-r--r-- | include/my_valgrind.h | 11 | ||||
-rw-r--r-- | include/welcome_copyright_notice.h | 2 |
4 files changed, 23 insertions, 18 deletions
diff --git a/include/my_compare.h b/include/my_compare.h index 0db22b593f4..87f0aa8f3ca 100644 --- a/include/my_compare.h +++ b/include/my_compare.h @@ -91,17 +91,19 @@ typedef struct st_HA_KEYSEG /* Key-portion */ #define size_to_store_key_length(length) ((length) < 255 ? 1 : 3) -#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \ - (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \ - ((1 << (bit_len)) - 1)) - -#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \ -{ \ - (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \ - ((bits) << (bit_ofs)); \ - if ((bit_ofs) + (bit_len) > 8) \ - (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \ - ((bits) >> (8 - (bit_ofs))); \ +static inline uint16 get_rec_bits(const uchar *ptr, uchar ofs, uint len) +{ + uint16 val= ptr[0]; + if (ofs + len > 8) + val|= (uint16)(ptr[1]) << 8; + return (val >> ofs) & ((1 << len) - 1); +} + +static inline void set_rec_bits(uint16 bits, uchar *ptr, uchar ofs, uint len) +{ + ptr[0]= (ptr[0] & ~(((1 << len) - 1) << ofs)) | (bits << ofs); + if (ofs + len > 8) + ptr[1]= (ptr[1] & ~((1 << (len - 8 + ofs)) - 1)) | (bits >> (8 - ofs)); } #define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ diff --git a/include/my_sys.h b/include/my_sys.h index cd74fdf427b..7b229bb52b0 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -641,9 +641,7 @@ extern int my_sync(File fd, myf my_flags); extern int my_sync_dir(const char *dir_name, myf my_flags); extern int my_sync_dir_by_file(const char *file_name, myf my_flags); extern void my_error(int nr,myf MyFlags, ...); -extern void my_printf_error(uint my_err, const char *format, - myf MyFlags, ...) - ATTRIBUTE_FORMAT(printf, 2, 4); +extern void my_printf_error(uint my_err, const char *format, myf MyFlags, ...); extern void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap); extern int my_error_register(const char** (*get_errmsgs) (), diff --git a/include/my_valgrind.h b/include/my_valgrind.h index 4bd4cf99ada..a9dba1cb06c 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -25,7 +25,13 @@ # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) # define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len) # define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) -#else /* HAVE_VALGRIND */ +#elif defined(__SANITIZE_ADDRESS__) +# include <sanitizer/asan_interface.h> +# define MEM_UNDEFINED(a,len) ASAN_UNPOISON_MEMORY_REGION(a,len) +# define MEM_NOACCESS(a,len) ASAN_POISON_MEMORY_REGION(a,len) +# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) +# define MEM_CHECK_DEFINED(a,len) ((void) 0) +#else # define MEM_UNDEFINED(a,len) ((void) 0) # define MEM_NOACCESS(a,len) ((void) 0) # define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) @@ -35,9 +41,8 @@ #ifndef DBUG_OFF #define TRASH_FILL(A,B,C) do { memset(A, C, B); MEM_UNDEFINED(A, B); } while (0) #else -#define TRASH_FILL(A,B,C) do{ MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) +#define TRASH_FILL(A,B,C) do { MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) #endif #define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5) #define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F) #define TRASH(A,B) TRASH_FREE(A,B) - diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index cd7cd6692be..1b4b17cfc0d 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -17,7 +17,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2017" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2018" /* This define specifies copyright notice which is displayed by every MySQL |