Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Aug 24, 2021

No description provided.

@nikic
Copy link
Member

nikic commented Aug 24, 2021

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.

Copy link
Member

@nikic nikic left a 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.

@krakjoe krakjoe added this to the PHP 8.2 milestone Aug 31, 2021
@cmb69
Copy link
Member

cmb69 commented Sep 14, 2021

As discussed, let's land this after PHP-8.1 has been branched off.

What happened two weeks ago. :)

@nikic
Copy link
Member

nikic commented Oct 13, 2021

Do you plan to merge this?

@dstogov
Copy link
Member Author

dstogov commented Oct 13, 2021

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.

@dstogov
Copy link
Member Author

dstogov commented Oct 13, 2021

@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;
Copy link
Member

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.

@dstogov
Copy link
Member Author

dstogov commented Oct 14, 2021

Merged via ddaf64b

@dstogov dstogov closed this Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants