Skip to content

Commit 093314f

Browse files
michaelldtrondeau
authored andcommittedJun 26, 2014
cmake: runtime: On Darwin, malloc is always aligned to a 16 byte boundary, to work with Altivec and SSE (etc) SIMD; so, set ALIGNED_MALLOC to 16 for those Darwin systems that do not have posix_memalign.
1 parent 5a9acd9 commit 093314f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎gnuradio-runtime/ConfigChecks.cmake

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ CHECK_CXX_SOURCE_COMPILES("
122122
)
123123
GR_ADD_COND_DEF(HAVE_VALLOC)
124124

125-
ADD_DEFINITIONS(-DALIGNED_MALLOC=0)
125+
if(APPLE)
126+
# Apple's malloc has been 16 byte aligned since at least 10.4
127+
ADD_DEFINITIONS(-DALIGNED_MALLOC=16)
128+
else()
129+
ADD_DEFINITIONS(-DALIGNED_MALLOC=0)
130+
endif()
126131

127132
########################################################################
128133
SET(CMAKE_REQUIRED_LIBRARIES -lpthread)

0 commit comments

Comments
 (0)
Please sign in to comment.