@@ -357,27 +357,16 @@ include(cmake/config/OpenVDBCXX.cmake)
357357
358358#########################################################################
359359
360- # Configure malloc library. Use Jemalloc for Linux and non-Maya, otherwise Tbbmalloc.
361- # * On Mac OSX, linking against Jemalloc < 4.3.0 seg-faults with this error:
362- # malloc: *** malloc_zone_unregister() failed for 0xaddress
363- # Houdini 17.5 and older ships with Jemalloc 3.6.0, so we make Tbbmalloc the default
364- # on Mac OSX (https://github.com/jemalloc/jemalloc/issues/420). Later versions of
365- # Jemalloc are thought to work, but haven't been tested.
366- # * On Windows, we follow SideFX's example in using Tbbmalloc due to the challenges
367- # of injecting into the Windows runtime to replace the system allocator.
368-
369- if ((OPENVDB_BUILD_BINARIES OR OPENVDB_BUILD_UNITTESTS) AND CONCURRENT_MALLOC STREQUAL "Auto" )
370- if (WIN32 OR APPLE OR USE_MAYA)
360+ # Configure malloc library. Use Jemalloc if available, tbbmalloc otherwise
361+
362+ if (CONCURRENT_MALLOC STREQUAL "Auto" )
363+ find_package (Jemalloc QUIET )
364+ if (NOT TARGET Jemalloc::jemalloc)
365+ message (WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
366+ It is recommended to use Jemalloc for optimum performance." )
371367 set (CONCURRENT_MALLOC "Tbbmalloc" )
372368 else ()
373- find_package (Jemalloc QUIET )
374- if (NOT TARGET Jemalloc::jemalloc)
375- message (WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
376- It is recommended to use Jemalloc for optimum performance." )
377- set (CONCURRENT_MALLOC "Tbbmalloc" )
378- else ()
379- set (CONCURRENT_MALLOC "Jemalloc" )
380- endif ()
369+ set (CONCURRENT_MALLOC "Jemalloc" )
381370 endif ()
382371endif ()
383372
0 commit comments