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

Reduce HashMap allocations. #13163

Closed
wants to merge 1 commit into from
Closed

Reduce HashMap allocations. #13163

wants to merge 1 commit into from

Conversation

cgaebel
Copy link
Contributor

@cgaebel cgaebel commented Mar 27, 2014

We previously allocated 3x for every HashMap creation and resize. This patch reduces it to 1x.

fn round_up_to_next(unrounded: uint, target_alignment: uint) -> uint {
assert!(is_power_of_two(target_alignment));
(unrounded + 1) & !(target_alignment - 1)
}
Copy link
Member

Choose a reason for hiding this comment

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

Could this make use of num::next_power_of_two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, nevermind.

@cgaebel
Copy link
Contributor Author

cgaebel commented Mar 30, 2014

Okay I fixed the alignment stuff. Please check again!

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase!

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
…o-actions, r=Veykril

fix: ide: exclude sized in go-to actions in hover

fixes rust-lang#13163

i opted to just simply omit `Sized` entirely from go-to actions, as opposed to including it if even someone writes an explicit `T: Sized`, as i think a go-to on Sized is of dubious value practically.
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 24, 2024
Fix case where doc_markdown is triggered on words ending with "ified"

Fixes rust-lang#13097.

r? `@Alexendoo`

changelog: Fix case where doc_markdown is triggered on words ending with "ified"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants