-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat(profiling) allocation profiling for PHP ZTS #2506
Conversation
e86caca
to
43a73ce
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2506 +/- ##
============================================
+ Coverage 75.91% 77.07% +1.16%
Complexity 2563 2563
============================================
Files 241 215 -26
Lines 27020 23048 -3972
Branches 976 0 -976
============================================
- Hits 20511 17765 -2746
+ Misses 5989 5283 -706
+ Partials 520 0 -520
Flags with carried forward coverage won't be shown. Click here to find out more. see 26 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
43a73ce
to
56240c2
Compare
4de9425
to
3cae5b2
Compare
0d71d43
to
e76dd1b
Compare
ea1d19c
to
fbdab6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe OnceCell
with cell.get_or_init(|| unreachable!())
and re-creating the OnceCell
on each request has good enough codegen to be able to use, and then we avoid the unsafe. Discussed this with Florian on Zoom and Slack.
fbdab6a
to
3a33646
Compare
4c70d21
to
14ece3d
Compare
…or the heap and the previous function pointers (if any)
ci skip For whatever reason, the linter fails in this macro. It can succeed in macros sometimes, just not this one.
Also merge prepare/restore zend heap fns into one field, since they are always used together, and allows us to use the new macro without fetching them twice.
3821da2
to
155d1ca
Compare
af595b3
to
81fa090
Compare
Description
PROF-8922 / #2070
This PR will bring allocation profiling to ZTS versions of PHP. In the "there is another custom handler installed" code path we are using an
UnsafeCell
for a thread local which is the cheapest way (evaluated at compile time and not runtime), as this is in the hot path (every allocation and free would borrow check at runtime).We could argue that the case of another extension that has custom handlers installed is nearly non existing, so we could also be better safe then sorry, but OTOH I could not get it to crash.
Reviewer checklist