From 1e22bd6dbfe371084b7916e1b1c059d9c028b197 Mon Sep 17 00:00:00 2001 From: Jason Elswick Date: Tue, 27 Oct 2026 10:09:12 -0500 Subject: [PATCH] mimalloc: update to 3.6.1. --- .../patches/0002-i686-pprof-test.patch | 48 +++++++++++++++++++ srcpkgs/mimalloc/template | 4 +- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/mimalloc/patches/0002-i686-pprof-test.patch diff --git a/srcpkgs/mimalloc/patches/0002-i686-pprof-test.patch b/srcpkgs/mimalloc/patches/0002-i686-pprof-test.patch new file mode 100644 index 00000000000000..7408db08728d2f --- /dev/null +++ b/srcpkgs/mimalloc/patches/0002-i686-pprof-test.patch @@ -0,0 +1,48 @@ +From 6cede1764e403be9bc75edb9a054bdc8044b8ff4 Mon Sep 17 00:00:00 2001 +From: Daan +Date: Mon, 2 Nov 2026 10:51:03 -0800 +Subject: [PATCH] fix pprof test, issue #1476 + +--- + test/test-pprof.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/test/test-pprof.c b/test/test-pprof.c +index 8af09d57..64d40bff 100644 +--- a/test/test-pprof.c ++++ b/test/test-pprof.c +@@ -617,8 +617,7 @@ bool test_pprof_concurrent_threads(void) { + #if defined(__linux__) + + #define PPROF_OOM_BASE_NAME "profile/test-pprof-oom" +-#define PPROF_OOM_MAX_BLOCKS (20000) +-#define PPROF_OOM_BLOCK_SIZE (64 * 1024) ++#define PPROF_OOM_MAX_BLOCKS (60000) + #define PPROF_OOM_RECURSION_DEPTH (120) + #define PPROF_OOM_RECURSION_REPS (4) + +@@ -673,13 +672,16 @@ bool test_pprof_snapshot_oom(void) { + + // 1. exhaust the arenas: from now on no new pages can be allocated + mi_option_set(mi_option_disallow_os_alloc, 1); ++ // (with decreasing block sizes as the remaining fragments may still fit smaller pages) + size_t block_count = 0; +- while (block_count < PPROF_OOM_MAX_BLOCKS) { +- void* b = mi_malloc(PPROF_OOM_BLOCK_SIZE); +- if (b == NULL) break; +- pprof_oom_blocks[block_count++] = b; ++ for (size_t block_size = 64 * 1024; block_size >= 1024; block_size /= 4) { ++ while (block_count < PPROF_OOM_MAX_BLOCKS) { ++ void* b = mi_malloc(block_size); ++ if (b == NULL) break; ++ pprof_oom_blocks[block_count++] = b; ++ } + } +- result = (block_count > 0); ++ result = (block_count > 0 && block_count < PPROF_OOM_MAX_BLOCKS); + + // 2. drain the profiler heap's remaining free space: these allocations + // still fit in its current pages, so they keep creating locations +-- +2.55.0 + diff --git a/srcpkgs/mimalloc/template b/srcpkgs/mimalloc/template index adfa10bfd25589..9ccf835b213626 100644 --- a/srcpkgs/mimalloc/template +++ b/srcpkgs/mimalloc/template @@ -1,6 +1,6 @@ # Template file for 'mimalloc' pkgname=mimalloc -version=3.5.4 +version=3.6.1 revision=1 build_style=cmake configure_args="-DCMAKE_BUILD_TYPE=Release -DMI_BUILD_OBJECT=OFF -DMI_INSTALL_TOPLEVEL=ON $(vopt_bool secure MI_SECURE)" @@ -9,7 +9,7 @@ maintainer="Jason Elswick " license="MIT" homepage="https://github.com/microsoft/mimalloc" distfiles="https://github.com/microsoft/mimalloc/archive/refs/tags/v${version}.tar.gz" -checksum=36e9b5bf1bb703567a0347491721ce2098000db8284dc55cd53d211452723cdb +checksum=2672e6a99d4579fb4bb32d9de0d63aa424ce600d31fbfaf06eb74d940d2e07a6 build_options="secure" build_options_default="secure"