Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #2415 'Use jemalloc instead of libc allocator'
- Loading branch information
Showing
79 changed files
with
1,519 additions
and
1,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# - Try to find jemalloc | ||
# Once done this will define | ||
# JEMALLOC_FOUND - System has jemalloc | ||
# JEMALLOC_INCLUDE_DIRS - The jemalloc include directories | ||
# JEMALLOC_LIBRARIES - The libraries needed to use jemalloc | ||
|
||
find_package(PkgConfig) | ||
if(NOT JEMALLOC_USE_BUNDLED) | ||
find_package(PkgConfig) | ||
if (PKG_CONFIG_FOUND) | ||
pkg_check_modules(PC_JEMALLOC QUIET jemalloc) | ||
endif() | ||
else() | ||
set(PC_JEMALLOC_INCLUDEDIR) | ||
set(PC_JEMALLOC_INCLUDE_DIRS) | ||
set(PC_JEMALLOC_LIBDIR) | ||
set(PC_JEMALLOC_LIBRARY_DIRS) | ||
set(LIMIT_SEARCH NO_DEFAULT_PATH) | ||
endif() | ||
|
||
set(JEMALLOC_DEFINITIONS ${PC_JEMALLOC_CFLAGS_OTHER}) | ||
|
||
find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h | ||
PATHS ${PC_JEMALLOC_INCLUDEDIR} ${PC_JEMALLOC_INCLUDE_DIRS} | ||
${LIMIT_SEARCH}) | ||
|
||
# If we're asked to use static linkage, add libjemalloc.a as a preferred library name. | ||
if(JEMALLOC_USE_STATIC) | ||
list(APPEND JEMALLOC_NAMES | ||
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
endif() | ||
|
||
list(APPEND JEMALLOC_NAMES jemalloc) | ||
|
||
find_library(JEMALLOC_LIBRARY NAMES ${JEMALLOC_NAMES} | ||
HINTS ${PC_JEMALLOC_LIBDIR} ${PC_JEMALLOC_LIBRARY_DIRS} | ||
${LIMIT_SEARCH}) | ||
|
||
set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY}) | ||
set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args(JeMalloc DEFAULT_MSG | ||
JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR) | ||
|
||
mark_as_advanced(JEMALLOC_INCLUDE_DIR JEMALLOC_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,5 +65,6 @@ | |
#define FEAT_BROWSE | ||
#define FEAT_CSCOPE | ||
#define FEAT_MOUSE | ||
#cmakedefine USE_JEMALLOC | ||
|
||
#endif // AUTO_CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.