Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-06-06 15:42:11 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-06-06 15:42:11 +1000
commit8c024511ca7236289115dfd1d312bae0c010c53d (patch)
treead21fc4197a64c8e438f97d9fc41eb9a894a2ad9 /source
parenta01968c3b090db55cc36cccc0eb8ded54ff1de6f (diff)
jemalloc stuff
Diffstat (limited to 'source')
-rw-r--r--source/CMakeLists.txt8
-rw-r--r--source/CMakePresets.json4
-rw-r--r--source/core/StarMemory.cpp18
3 files changed, 4 insertions, 26 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index db36cd6..abcdff1 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -457,15 +457,11 @@ endif()
# Find all required external libraries, based on build settings...
-
-
-
if(STAR_USE_JEMALLOC)
find_package(PkgConfig)
- pkg_check_modules(JEMALLOC REQUIRED jemalloc)
+ pkg_check_modules(JEMALLOC REQUIRED IMPORTED_TARGET GLOBAL jemalloc)
- include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
- set(STAR_EXT_LIBS ${JEMALLOC_LIBRARY})
+ set(STAR_EXT_LIBS PkgConfig::JEMALLOC)
endif()
if (STAR_USE_MIMALLOC)
diff --git a/source/CMakePresets.json b/source/CMakePresets.json
index 61b4502..8e96181 100644
--- a/source/CMakePresets.json
+++ b/source/CMakePresets.json
@@ -32,8 +32,8 @@
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
"CMAKE_INCLUDE_PATH": "${sourceParentDir}/lib/windows/include",
"CMAKE_LIBRARY_PATH": "${sourceParentDir}/lib/windows",
- "STAR_USE_RPMALLOC": false,
- "STAR_USE_JEMALLOC": true
+ "STAR_USE_RPMALLOC": true,
+ "STAR_USE_JEMALLOC": false
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
diff --git a/source/core/StarMemory.cpp b/source/core/StarMemory.cpp
index c7818f3..9a9b2d2 100644
--- a/source/core/StarMemory.cpp
+++ b/source/core/StarMemory.cpp
@@ -19,7 +19,6 @@ static bool _rpm_linker_ref = rpm_linker_ref();
namespace Star {
#ifdef STAR_USE_JEMALLOC
-#ifdef STAR_JEMALLOC_IS_PREFIXED
void* malloc(size_t size) {
return je_malloc(size);
}
@@ -36,23 +35,6 @@ namespace Star {
if (ptr)
je_sdallocx(ptr, size, 0);
}
-#else
- void* malloc(size_t size) {
- return ::malloc(size);
- }
-
- void* realloc(void* ptr, size_t size) {
- return ::realloc(ptr, size);
- }
-
- void free(void* ptr) {
- ::free(ptr);
- }
-
- void free(void* ptr, size_t size) {
- ::free(ptr);
- }
-#endif
#elif STAR_USE_MIMALLOC
void* malloc(size_t size) {
return mi_malloc(size);