aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaMaex <damaex@live.de>2019-10-31 08:02:20 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-18 23:44:42 +0100
commit657fab8cb952783f3b5c17221cc70e621169f900 (patch)
treedde5ba943bf0e2e2e9397c6432a20f7721fa2e49
parent20a772634c205f5f9fd1b2bd1618aea7a9e5a5e5 (diff)
added jemalloc configuration to CMake for CPU_SINWAIT (#23898)
(cherry picked from commit 4bf80e2f18eabc91519526591be48bca6947a9b1)
-rw-r--r--dep/jemalloc/CMakeLists.txt8
-rw-r--r--dep/jemalloc/jemalloc_internal_defs.h.in.cmake4
2 files changed, 10 insertions, 2 deletions
diff --git a/dep/jemalloc/CMakeLists.txt b/dep/jemalloc/CMakeLists.txt
index 50082b2fc26..653c322f5f7 100644
--- a/dep/jemalloc/CMakeLists.txt
+++ b/dep/jemalloc/CMakeLists.txt
@@ -28,6 +28,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
set(JEM_MADFREE_DEF "#undef")
endif()
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+ set(JEM_CPU_SPINWAIT "")
+ set(JEM_HAVE_CPU_SPINWAIT 0)
+ else()
+ set(JEM_CPU_SPINWAIT "__asm__ volatile\(\"pause\"\)")
+ set(JEM_HAVE_CPU_SPINWAIT 1)
+ endif()
+
# Create the header, so we can use it
configure_file(
"${CMAKE_SOURCE_DIR}/dep/jemalloc/jemalloc_internal_defs.h.in.cmake"
diff --git a/dep/jemalloc/jemalloc_internal_defs.h.in.cmake b/dep/jemalloc/jemalloc_internal_defs.h.in.cmake
index 0c592eaa7f6..28f7e9386fe 100644
--- a/dep/jemalloc/jemalloc_internal_defs.h.in.cmake
+++ b/dep/jemalloc/jemalloc_internal_defs.h.in.cmake
@@ -33,9 +33,9 @@
* Hyper-threaded CPUs may need a special instruction inside spin loops in
* order to yield to another virtual CPU.
*/
-#define CPU_SPINWAIT __asm__ volatile("pause")
+#define CPU_SPINWAIT @JEM_CPU_SPINWAIT@
/* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
-#define HAVE_CPU_SPINWAIT 1
+#define HAVE_CPU_SPINWAIT @JEM_HAVE_CPU_SPINWAIT@
/*
* Number of significant bits in virtual addresses. This may be less than the