diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-09-06 22:45:19 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-09-06 22:45:19 +0200 |
commit | 31081593aabb116b6d8f86b6c7e76126edb392b4 (patch) | |
tree | 767a069f255359b5ea37e7c491dfeacf6e519fad /storage/tokudb/PerconaFT/portability | |
parent | b0026e33af8fc3b25a42099c096a84591fd550e2 (diff) | |
parent | 3a4242fd57b3a2235d2478ed080941b67a82ad1b (diff) | |
download | mariadb-git-31081593aabb116b6d8f86b6c7e76126edb392b4.tar.gz |
Merge branch '11.0' into 10.1
Diffstat (limited to 'storage/tokudb/PerconaFT/portability')
7 files changed, 18 insertions, 17 deletions
diff --git a/storage/tokudb/PerconaFT/portability/memory.cc b/storage/tokudb/PerconaFT/portability/memory.cc index 9594158cf38..403abfe1d68 100644 --- a/storage/tokudb/PerconaFT/portability/memory.cc +++ b/storage/tokudb/PerconaFT/portability/memory.cc @@ -182,7 +182,7 @@ toku_memory_footprint(void * p, size_t touched) void * toku_malloc(size_t size) { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { return nullptr; } @@ -209,7 +209,7 @@ toku_malloc(size_t size) { } void *toku_malloc_aligned(size_t alignment, size_t size) { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { return nullptr; } @@ -245,7 +245,7 @@ toku_calloc(size_t nmemb, size_t size) { void * toku_realloc(void *p, size_t size) { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { if (p != nullptr) { toku_free(p); @@ -276,7 +276,7 @@ toku_realloc(void *p, size_t size) { } void *toku_realloc_aligned(size_t alignment, void *p, size_t size) { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { if (p != nullptr) { toku_free(p); @@ -345,7 +345,7 @@ toku_free(void *p) { void * toku_xmalloc(size_t size) { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { return nullptr; } @@ -375,7 +375,7 @@ void* toku_xmalloc_aligned(size_t alignment, size_t size) // Fail with a resource_assert if the allocation fails (don't return an error code). // Requires: alignment is a power of two. { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { return nullptr; } @@ -409,7 +409,7 @@ toku_xcalloc(size_t nmemb, size_t size) { void * toku_xrealloc(void *v, size_t size) { -#if __APPLE__ +#if defined(__APPLE__) if (size == 0) { if (v != nullptr) { toku_free(v); diff --git a/storage/tokudb/PerconaFT/portability/toku_assert.h b/storage/tokudb/PerconaFT/portability/toku_assert.h index b0a7be3287b..a5593a93ed8 100644 --- a/storage/tokudb/PerconaFT/portability/toku_assert.h +++ b/storage/tokudb/PerconaFT/portability/toku_assert.h @@ -126,7 +126,7 @@ void db_env_do_backtrace(FILE *outf); #define resource_assert_zero(a) assert_zero(a) // indicates resource must be available, otherwise unrecoverable #define resource_assert_equals(a, b) assert_equals(a, b) // indicates resource must be available, otherwise unrecoverable -#if TOKU_DEBUG_PARANOID +#if defined(TOKU_DEBUG_PARANOID) && TOKU_DEBUG_PARANOID #define paranoid_invariant(a) assert(a) #define paranoid_invariant_null(a) assert_null(a) #define paranoid_invariant_notnull(a) assert(a) diff --git a/storage/tokudb/PerconaFT/portability/toku_debug_sync.h b/storage/tokudb/PerconaFT/portability/toku_debug_sync.h index 493075c36c3..6ed052098f6 100644 --- a/storage/tokudb/PerconaFT/portability/toku_debug_sync.h +++ b/storage/tokudb/PerconaFT/portability/toku_debug_sync.h @@ -40,7 +40,8 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. struct tokutxn; -#if defined(ENABLED_DEBUG_SYNC) +#if defined(MYSQL_TOKUDB_ENGINE) && MYSQL_TOKUDB_ENGINE && \ + defined(ENABLED_DEBUG_SYNC) && ENABLED_DEBUG_SYNC /* the below macros are defined in my_global.h, which is included in m_string.h, diff --git a/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc b/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc index b7b4c0ab233..d742555f878 100644 --- a/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc +++ b/storage/tokudb/PerconaFT/portability/toku_instr_mysql.cc @@ -1,4 +1,4 @@ -#ifdef MYSQL_TOKUDB_ENGINE +#ifdef TOKU_MYSQL_WITH_PFS #include "toku_portability.h" #include "toku_pthread.h" @@ -18,7 +18,7 @@ int toku_pthread_create(const toku_instr_key &key, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) { -#if (MYSQL_VERSION_MAJOR >= 5) && (MYSQL_VERSION_MINOR >= 7) +#if (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) return PSI_THREAD_CALL(spawn_thread)( key.id(), reinterpret_cast<my_thread_handle *>(thread), attr, start_routine, arg); @@ -362,4 +362,4 @@ void toku_instr_rwlock_unlock(toku_pthread_rwlock_t &rwlock) { PSI_RWLOCK_CALL(unlock_rwlock)(rwlock.psi_rwlock); } -#endif // MYSQL_TOKUDB_ENGINE +#endif // TOKU_MYSQL_WITH_PFS diff --git a/storage/tokudb/PerconaFT/portability/toku_instrumentation.h b/storage/tokudb/PerconaFT/portability/toku_instrumentation.h index c300f9275b8..7f2946d9702 100644 --- a/storage/tokudb/PerconaFT/portability/toku_instrumentation.h +++ b/storage/tokudb/PerconaFT/portability/toku_instrumentation.h @@ -41,7 +41,7 @@ class toku_instr_probe_empty { extern toku_instr_key toku_uninstrumented; -#ifndef MYSQL_TOKUDB_ENGINE +#ifndef TOKU_MYSQL_WITH_PFS #include <pthread.h> @@ -245,10 +245,10 @@ inline void toku_instr_rwlock_wrlock_wait_end( inline void toku_instr_rwlock_unlock(UU(toku_pthread_rwlock_t &rwlock)) {} -#else // MYSQL_TOKUDB_ENGINE +#else // TOKU_MYSQL_WITH_PFS // There can be not only mysql but also mongodb or any other PFS stuff #include <toku_instr_mysql.h> -#endif // MYSQL_TOKUDB_ENGINE +#endif // TOKU_MYSQL_WITH_PFS extern toku_instr_key toku_uninstrumented; diff --git a/storage/tokudb/PerconaFT/portability/toku_portability.h b/storage/tokudb/PerconaFT/portability/toku_portability.h index 8a3dcf5afc4..af49f8eeb04 100644 --- a/storage/tokudb/PerconaFT/portability/toku_portability.h +++ b/storage/tokudb/PerconaFT/portability/toku_portability.h @@ -69,7 +69,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include <sys/stat.h> #include <stdio.h> -#if __FreeBSD__ +#if defined(__FreeBSD__) #include <stdarg.h> #endif diff --git a/storage/tokudb/PerconaFT/portability/toku_race_tools.h b/storage/tokudb/PerconaFT/portability/toku_race_tools.h index 96712ffffdc..eee08185513 100644 --- a/storage/tokudb/PerconaFT/portability/toku_race_tools.h +++ b/storage/tokudb/PerconaFT/portability/toku_race_tools.h @@ -45,7 +45,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #define USE_VALGRIND 1 #endif -#if defined(__linux__) && USE_VALGRIND +#if defined(__linux__) && defined(USE_VALGRIND) && USE_VALGRIND # include <valgrind/helgrind.h> # include <valgrind/drd.h> |