-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Avoid non-immutable map_ptr indirection #7394
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
Conversation
This extra patch mostly fixes closure support: https://gist.github.com/nikic/898f766722839d27a9d599f653c80a8c However, there is a problem: For fake closures we want to share static variables between the function and the closure. However, the closure has a separate copy of the function. Without the indirection pointer, they will now have two independent static_variables pointers. |
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.
As discussed, let's land this after PHP-8.1 has been branched off.
What happened two weeks ago. :) |
Do you plan to merge this? |
I already forgot about this. I'll need to fix merge conflicts first. I'll do this when have more time. |
@nikic could you please make a quick review once again |
@@ -309,10 +309,10 @@ static void zend_accel_do_delayed_early_binding( | |||
{ | |||
ZEND_ASSERT(!ZEND_MAP_PTR(op_array->run_time_cache)); | |||
ZEND_ASSERT(op_array->fn_flags & ZEND_ACC_HEAP_RT_CACHE); | |||
void *ptr = emalloc(op_array->cache_size + sizeof(void*)); | |||
void *ptr = emalloc(op_array->cache_size); | |||
char *run_time_cache = ptr; |
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 think you can drop the ptr
variable here and use only run_time_cache
.
Merged via ddaf64b |
No description provided.