make `usingJEMalloc()` a constexpr when USE_JEMALLOC is defined
[folly.git] / folly / memory / Malloc.h
index 5bad7484a9a5dc2a524bb3d38e94a513061a45e7..e774dd0e907bffe80f1c473ac4ac872685906054 100644 (file)
@@ -147,6 +147,11 @@ namespace folly {
 /**
  * Determine if we are using jemalloc or not.
  */
+#ifdef USE_JEMALLOC
+inline bool usingJEMalloc() noexcept {
+  return true;
+}
+#else
 FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept {
   // Checking for rallocx != nullptr is not sufficient; we may be in a
   // dlopen()ed module that depends on libjemalloc, so rallocx is resolved, but
@@ -194,6 +199,7 @@ FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept {
 
   return result;
 }
+#endif
 
 inline size_t goodMallocSize(size_t minSize) noexcept {
   if (minSize == 0) {