File tree Expand file tree Collapse file tree 4 files changed +10
-26
lines changed Expand file tree Collapse file tree 4 files changed +10
-26
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,6 @@ IF(NOT MSVC)
94
94
SET_SOURCE_FILES_PROPERTIES (trx/trx0rec.cc PROPERTIES COMPILE_FLAGS -O1 )
95
95
ENDIF ()
96
96
97
- CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN )
98
- IF (HAVE_POSIX_MEMALIGN )
99
- ADD_DEFINITIONS (-DHAVE_POSIX_MEMALIGN )
100
- ENDIF ()
101
-
102
97
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
103
98
# workaround for old gcc on x86, gcc atomic ops only work under -march=i686
104
99
IF (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
Original file line number Diff line number Diff line change @@ -82,19 +82,16 @@ Created 11/5/1995 Heikki Tuuri
82
82
#include " snappy-c.h"
83
83
#endif
84
84
85
- inline void * aligned_malloc (size_t size, size_t align) {
86
- void *result;
85
+ static void * aligned_malloc (size_t size, size_t align)
86
+ {
87
87
#ifdef _MSC_VER
88
- result = _aligned_malloc (size, align);
89
- #elif defined (HAVE_POSIX_MEMALIGN)
90
- if (posix_memalign (&result, align, size)) {
91
- result = 0 ;
92
- }
88
+ return _aligned_malloc (size, align);
93
89
#else
94
- /* Use unaligned malloc as fallback */
95
- result = malloc (size);
90
+ void *result;
91
+ if (posix_memalign (&result, align, size))
92
+ result= NULL ;
96
93
#endif
97
- return result;
94
+ return result;
98
95
}
99
96
100
97
inline void aligned_free (void *ptr) {
Original file line number Diff line number Diff line change @@ -93,11 +93,6 @@ MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-class-memaccess")
93
93
94
94
IF (NOT MSVC )
95
95
96
- CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN )
97
- IF (HAVE_POSIX_MEMALIGN )
98
- ADD_DEFINITIONS (-DHAVE_POSIX_MEMALIGN )
99
- ENDIF ()
100
-
101
96
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
102
97
# workaround for old gcc on x86, gcc atomic ops only work under -march=i686
103
98
IF (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
Original file line number Diff line number Diff line change @@ -92,17 +92,14 @@ buf_mark_space_corrupt(
92
92
/* prototypes for new functions added to ha_innodb.cc */
93
93
trx_t * innobase_get_trx ();
94
94
95
- inline void * aligned_malloc (size_t size, size_t align) {
95
+ static void * aligned_malloc (size_t size, size_t align) {
96
96
void *result;
97
97
#ifdef _MSC_VER
98
98
result = _aligned_malloc (size, align);
99
- #elif defined (HAVE_POSIX_MEMALIGN)
99
+ #else
100
100
if (posix_memalign (&result, align, size)) {
101
- result = 0 ;
101
+ result = NULL ;
102
102
}
103
- #else
104
- /* Use unaligned malloc as fallback */
105
- result = malloc (size);
106
103
#endif
107
104
return result;
108
105
}
You can’t perform that action at this time.
0 commit comments