Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions srcpkgs/mimalloc/patches/0002-i686-pprof-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 6cede1764e403be9bc75edb9a054bdc8044b8ff4 Mon Sep 17 00:00:00 2001
From: Daan <daanl@outlook.com>
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

4 changes: 2 additions & 2 deletions srcpkgs/mimalloc/template
Original file line number Diff line number Diff line change
@@ -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)"
Expand All @@ -9,7 +9,7 @@ maintainer="Jason Elswick <jason@jasondavid.us>"
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"
Expand Down
Loading