-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.
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.
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