Repository navigation
Switch mimalloc to the v3 line - #1252
Merged
Merged
Conversation
|
StaticPHP Test Bot Detected: Extensions: none | Libraries: |
Owner
|
Well, it seems our test process doesn't cover mimalloc. It isn't directly depended upon by any target. |
crazywhalecc
approved these changes
Oct 10, 2026
crazywhalecc
left a comment
Owner
There was a problem hiding this comment.
Change is simple, absolutely good for me, but still not tested though. I'll leave this to @henderkes .
Collaborator
|
Works, merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Switches mimalloc from the v2 line to the v3 line.
bin/spc download mimallocnow fetches v3.5.4.Why:
[^3]was added in mimalloc v2.2.3 is bugged on musl #692 to skip v2.2.3, which was broken on musl. In its current form,v2\.\d\.[^3], it also skips every other v2.x.3 release.The new pattern
v3\.\d+\.\d+$only matches stablevX.Y.Ztags, so it skips thewin-m4tag and pre-releases such asv3.0.2-beta. The CMake options set insrc/Package/Library/mimalloc.php(MI_BUILD_SHARED,MI_BUILD_OBJECT,MI_INSTALL_TOPLEVEL,MI_LIBC_MUSL) all exist in v3.5.4.Testing
I tested with FrankenPHP static builds (php/frankenphp#2618): PHP 8.5.11 ZTS with
bcmath,ctype,curl,filter,mbstring,opcache,openssl,pdo_sqlite,session,sqlite3,tokenizer,zlib.static-builder-muslimage with the nightly spc andcustom-urlpointing to the v3.5.4 tarball.On both,
MIMALLOC_VERBOSE=1printsv3.5.4, releaseat startup.spc v3 currently doesn't put
libmimalloc.aon the frankenphp link line:SPCConfigUtil::configForResolvedBuild()only covers the frankenphp package closure, and mimalloc isn't in it. The binary builds, but it uses the system allocator. For these tests I added the archive withfrankenphp_LDFLAGS. This PR doesn't change that.Runtime tests, run on both binaries. None of them crashed or printed mimalloc errors:
php-clirunning an allocation-heavy script (random-size strings, cyclic objects, large strings, big hash tables), with and withoutUSE_ZEND_ALLOC=0. WithUSE_ZEND_ALLOC=0, peak RSS was 233 MB with mimalloc vs 371 MB with the system allocator on macOS, and 251 MB vs 469 MB on musl.ab -k -c 64. No failed connections, no non-2xx responses, and RSS stayed flat:Not tested: glibc builds and x86_64.
Checklist before merging
*.phpor*.yml, run them locally to ensure your changes are valid:composer cs-fix(no PHP changes)composer analyse(no PHP changes)composer testbin/spc dev:lint-config(only flagsconfig/pkg/lib/lcms2.yml, which is already unsorted onv3)