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

summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-06-06 14:53:24 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-06-06 14:53:24 +1000
commita01968c3b090db55cc36cccc0eb8ded54ff1de6f (patch)
treea0f2193160358dd2ca9af74d7ebf7081b3e90688 /source
parent214c8c939f377abed795cf6d66929e3a07c6820c (diff)
fetch jemalloc from vcpkg
Diffstat (limited to 'source')
-rw-r--r--source/CMakeLists.txt9
-rw-r--r--source/CMakePresets.json3
-rw-r--r--source/core/StarMemory.cpp3
-rw-r--r--source/vcpkg.json4
4 files changed, 12 insertions, 7 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 131c6ad..db36cd6 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -457,11 +457,14 @@ endif()
# Find all required external libraries, based on build settings...
+
+
+
if(STAR_USE_JEMALLOC)
- # Assumes jemalloc was configured with a "je_" function prefix
- find_package(JeMalloc REQUIRED)
+ find_package(PkgConfig)
+ pkg_check_modules(JEMALLOC REQUIRED jemalloc)
- include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIR})
+ include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
set(STAR_EXT_LIBS ${JEMALLOC_LIBRARY})
endif()
diff --git a/source/CMakePresets.json b/source/CMakePresets.json
index 8deba06..61b4502 100644
--- a/source/CMakePresets.json
+++ b/source/CMakePresets.json
@@ -32,7 +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": true
+ "STAR_USE_RPMALLOC": false,
+ "STAR_USE_JEMALLOC": true
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
diff --git a/source/core/StarMemory.cpp b/source/core/StarMemory.cpp
index 6ecc509..c7818f3 100644
--- a/source/core/StarMemory.cpp
+++ b/source/core/StarMemory.cpp
@@ -50,8 +50,7 @@ namespace Star {
}
void free(void* ptr, size_t size) {
- if (ptr)
- ::sdallocx(ptr, size, 0);
+ ::free(ptr);
}
#endif
#elif STAR_USE_MIMALLOC
diff --git a/source/vcpkg.json b/source/vcpkg.json
index 6eab46c..f6aa482 100644
--- a/source/vcpkg.json
+++ b/source/vcpkg.json
@@ -10,6 +10,8 @@
"libpng",
"opus",
"zstd",
- "mimalloc"
+ "mimalloc",
+ "jemalloc",
+ "pkgconf"
]
} \ No newline at end of file