-
Notifications
You must be signed in to change notification settings - Fork 166
fix(prof): allocation profiling for PHP 8.4 #3550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
86c67e3 to
2c2f87d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3550 +/- ##
=======================================
Coverage 61.81% 61.81%
=======================================
Files 140 140
Lines 13281 13281
Branches 1758 1758
=======================================
Hits 8209 8209
Misses 4282 4282
Partials 790 790 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ profiler ]Benchmark execution time: 2026-01-13 14:24:58 Comparing candidate commit 4cee785 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 28 metrics, 7 unstable metrics. scenario:php-profiler-timeline-memory-with-profiler
|
4e8b1eb to
b061348
Compare
|
c24208c to
1653fa2
Compare
1653fa2 to
4cee785
Compare
Description
Since #3360 and with #3361 we disabled the code path for PHP 8.4's
php_zend_mm_set_custom_handlers_ex(). This PR re-enables that code path again.This uses the same approach as PHP <= 8.3 allocation profiling with the difference that for
alloc(),realloc()andfree()calls we do not "prepare" the ZendMM heap by manipulating theheap->use_custom_heapflag anymore. This was necessary for when the allocation fails, ZendMM might callzend_mm_gc()to try and free memory for a new chunk which would justreturn 0;in case a custom allocator is installed.With us being able to hook into
zend_mm_gc()we can stop manipulating theheap->use_custom_heapflag in the allocator hot path and only do so in case azend_mm_gc()was triggered.Additionally this adds a prof correctness tests with another custom allocator being used by setting
USE_ZEND_ALLOC=0.Reviewer checklist