Skip to content

Conversation

devnexen
Copy link
Member

explictly allocate packed arrays when it applies.

explictly allocate packed arrays when it applies.
@devnexen devnexen marked this pull request as ready for review April 20, 2025 14:53
ext/gd/gd.c Outdated
array_init(return_value);
add_next_index_long(return_value, gdImageResolutionX(im));
add_next_index_long(return_value, gdImageResolutionY(im));
array_init_size(return_value, 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's zend_new_pair for an optimized version of returning a packed array of 2 elements

@devnexen devnexen merged commit 2c3a2da into php:master Apr 20, 2025
9 checks passed
@devnexen devnexen deleted the gd_packed_array branch April 20, 2025 16:30
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.

2 participants