Commit ee207f19 authored by Bin Liu's avatar Bin Liu Committed by Facebook Github Bot

make `usingJEMalloc()` a constexpr when USE_JEMALLOC is defined

Summary: This would save some function calls and reduce code size if we know we will use jemalloc.

Reviewed By: yfeldblum

Differential Revision: D6411810

fbshipit-source-id: 9db471678e473945f5f00354c0a1285ecdb91de6
parent 13e576ac
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment