Skip to content

Always init descriptors ht as non-packed #29

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

Merged
merged 5 commits into from
Jun 3, 2025

Conversation

mvorisek
Copy link
Collaborator

@mvorisek mvorisek commented Jun 3, 2025

fix #4

Simillar to many of zend_hash_real_init_mixed() usage in php-src.

Credit goes to @nielsdos as he identified the problem is in https://github.com/php/pecl-database-oci8/blob/v3.4/oci8_lob.c#L106.

@mvorisek mvorisek marked this pull request as ready for review June 3, 2025 21:21
@mvorisek
Copy link
Collaborator Author

mvorisek commented Jun 3, 2025

@nielsdos I think I nailed the solution. Can you please approve this PR?

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

So the missing piece of the puzzle is that the bottom slots of the packed array were never reused and then the conversion happens once the "load factor" heuristic triggers. Then we still have some unused slots because of how the conversion works and we are left with unused memory.
The idea makes sense.

@mvorisek mvorisek merged commit 7aa1061 into php:main Jun 3, 2025
22 checks passed
@mvorisek mvorisek deleted the fix_ht_resize_at_9th_iter branch June 3, 2025 22:27
mvorisek added a commit that referenced this pull request Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants