[mimalloc] Fix android, clarify usage (#35713)

This commit is contained in:
Kai Pastor 2023-12-18 22:21:13 +01:00 committed by GitHub
parent 063265300c
commit 8e03049b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 6 deletions

View File

@ -1,11 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO microsoft/mimalloc
REF "v${VERSION}"
SHA512 927b046e67783b325a6e41e3a9a6d3d78306fa1c82255defd1f3a7a60a27fd809a601f65b1b27fa38f2064e124f29856d7c0e5ccc33c54c2e4b6ebb9816d74b1
REF "v${VERSION}"
SHA512 927b046e67783b325a6e41e3a9a6d3d78306fa1c82255defd1f3a7a60a27fd809a601f65b1b27fa38f2064e124f29856d7c0e5ccc33c54c2e4b6ebb9816d74b1
HEAD_REF master
PATCHES
fix-cmake.patch
template-param-types.diff
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -39,6 +40,7 @@ vcpkg_copy_pdbs()
file(COPY
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake"
"${CMAKE_CURRENT_LIST_DIR}/usage"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/mimalloc)

View File

@ -0,0 +1,22 @@
diff --git a/src/arena.c b/src/arena.c
index a04a04c..1340a96 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -476,7 +476,7 @@ static void mi_arena_schedule_purge(mi_arena_t* arena, size_t bitmap_idx, size_t
// schedule decommit
mi_msecs_t expire = mi_atomic_loadi64_relaxed(&arena->purge_expire);
if (expire != 0) {
- mi_atomic_addi64_acq_rel(&arena->purge_expire, delay/10); // add smallish extra delay
+ mi_atomic_addi64_acq_rel(&arena->purge_expire, (mi_msecs_t)delay/10); // add smallish extra delay
}
else {
mi_atomic_storei64_release(&arena->purge_expire, _mi_clock_now() + delay);
@@ -520,7 +520,7 @@ static bool mi_arena_try_purge(mi_arena_t* arena, mi_msecs_t now, bool force, mi
if (!force && expire > now) return false;
// reset expire (if not already set concurrently)
- mi_atomic_casi64_strong_acq_rel(&arena->purge_expire, &expire, 0);
+ mi_atomic_casi64_strong_acq_rel(&arena->purge_expire, &expire, (mi_msecs_t)0);
// potential purges scheduled, walk through the bitmap
bool any_purged = false;

4
ports/mimalloc/usage Normal file
View File

@ -0,0 +1,4 @@
mimalloc provides CMake targets:
find_package(mimalloc CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:mimalloc-static>,mimalloc-static,mimalloc)

View File

@ -1,6 +1,7 @@
{
"name": "mimalloc",
"version": "2.1.2",
"port-version": 1,
"description": "Compact general purpose allocator with excellent performance",
"homepage": "https://github.com/microsoft/mimalloc",
"license": "MIT",

View File

@ -695,9 +695,6 @@ mfx-dispatch:arm-neon-android=fail
mfx-dispatch:arm64-android=fail
mfx-dispatch:x64-android=fail
milerius-sfml-imgui:x64-windows-static=fail
mimalloc:arm-neon-android=fail
mimalloc:arm64-android=fail
mimalloc:x64-android=fail
minifb:arm-neon-android=fail
minifb:arm64-android=fail
minifb:x64-android=fail

View File

@ -5574,7 +5574,7 @@
},
"mimalloc": {
"baseline": "2.1.2",
"port-version": 0
"port-version": 1
},
"minc": {
"baseline": "2.4.03",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "db19c496e6855e8aeb3a8666ffae862910b403c4",
"version": "2.1.2",
"port-version": 1
},
{
"git-tree": "bffb93e0abd806e613f2d6dbe35db0768368cae2",
"version": "2.1.2",