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

micro-optimize dynamic allocation alignment #17095

Closed
wants to merge 2 commits into from
Closed

micro-optimize dynamic allocation alignment #17095

wants to merge 2 commits into from

Conversation

thestinger
Copy link
Contributor

Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092

@@ -149,12 +149,24 @@ unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint,
alloc as *mut u8
}

// The minimum alignment guaranteed by the architecture. This value is used to
Copy link
Member

Choose a reason for hiding this comment

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

"guaranteed by jemalloc on this architecture", or is it actually part of the architecture's ABI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's part of the ABI and therefore jemalloc and other allocators have to provide it as the minimum. Since jemalloc has to be compatible with system allocators, I just took the numbers from there.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, cool. I was just wondering if this was an additional guarantee provided by jemalloc or not.

Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092
bors added a commit that referenced this pull request Sep 10, 2014
Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092
@bors bors closed this Sep 10, 2014
@thestinger thestinger deleted the alloc branch September 16, 2014 06:42
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Add CONTRIBUTING.md

I'm not great with these kinds of documents, but the main point I want to be able to raise is that feature implementations should have an issue raised first for discussion.
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Add CONTRIBUTING.md

I'm not great with these kinds of documents, but the main point I want to be able to raise is that feature implementations should have an issue raised first for discussion.
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.

optimize dynamic allocation alignment
3 participants