-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Allow specifying function alignment #75072
Copy link
Copy link
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
I've been recently writing a kernel for the RISC-V architecture, using strictly as much Rust as I can get away with and during which I've run into the need to have certain functions aligned to specific byte alignments (ex. any function placed in
mtvecMUST be 4 byte aligned), and while I can seemingly accomplish this usingasm!(".align <alignment>")I think it would make sense for that to be an attribute of the function itself, whether it be limited toextern "C"fns or valid on all ABIs. Example of what I am asking for: