Skip to content

Fix incorrect sign for expanding arrays into subsequent pages - #21616

Merged
dkorpel merged 1 commit into
dlang:masterfrom
schveiguy:fix-array-extend-21615
Jul 28, 2025
Merged

Fix incorrect sign for expanding arrays into subsequent pages#21616
dkorpel merged 1 commit into
dlang:masterfrom
schveiguy:fix-array-extend-21615

Conversation

@schveiguy

Copy link
Copy Markdown
Member

Dumb sign error...

@dlang-bot

Copy link
Copy Markdown

Thanks for your pull request, @schveiguy!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

  • In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example, Fix Bugzilla Issue 12345 or Fix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#21616"

@schveiguy
schveiguy force-pushed the fix-array-extend-21615 branch from 3fff564 to 00b3f46 Compare July 28, 2025 21:13
appending to a large array that could potentially use extend, when the
requested array size is within a certain size for a multiple of pages.

The calculation had the wrong sign for the large padding (the 2 size_t +
1 byte), which made it end up sending a number very close to size_t.max
  into the extend function.

This affected both appending and setting length performance, though
appending also had a grow factor which may have mitigated this somewhat.
@schveiguy
schveiguy force-pushed the fix-array-extend-21615 branch from 00b3f46 to 353f5d5 Compare July 28, 2025 21:14
@Geod24

Geod24 commented Jul 28, 2025

Copy link
Copy Markdown
Member

Stable ?

@dkorpel

dkorpel commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

It's targeting 2.112.0 either way

@dkorpel
dkorpel merged commit c6c921f into dlang:master Jul 28, 2025
39 of 43 checks passed
@schveiguy
schveiguy deleted the fix-array-extend-21615 branch July 29, 2025 00:39
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