Skip to content
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

Remove unnecessary NoPointersBitmapPayload template. #20836

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

schveiguy
Copy link
Member

Just noticed this, as I was trying to work on Associative Array fixes, and felt like this was worth a quick PR. Should save a few template instantiations.

@schveiguy schveiguy added the Review:Trivial typos, formatting, comments label Feb 8, 2025
@dlang-bot
Copy link
Contributor

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.

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#20836"

@thewilsonator thewilsonator added the Druntime Specific to druntime label Feb 8, 2025
@LightBender
Copy link
Contributor

Is this possibly used by @rainers precise GC?

@schveiguy
Copy link
Member Author

schveiguy commented Feb 8, 2025

No, just the RTInfo is used. This template is only used to generate RTInfo, and it's only used to provide an enum to compare the pointer bitmap against.

Essentially, the RTInfo bitmap determines which word-sized chunks are pointers, and which aren't. The compiler provides the bitmaps, all this is doing is optimizing out cases where there are no pointers (to save on template instantiation).

Take a good look at the template, and see what it does. NoPointersBitmapPayload!N basically evaluates to size_t[N].init. I just replaced it to avoid the extra template.

Note: it's very likely this was tried, and didn't work back when it was added. I don't see why @kinke wouldn't have done that in the first place if it worked.

@dlang-bot dlang-bot merged commit 935d72a into dlang:master Feb 8, 2025
42 checks passed
@schveiguy schveiguy deleted the pbmimprovement branch February 8, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Druntime Specific to druntime Merge:auto-merge Review:Trivial typos, formatting, comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants