Update text/3594-expose-stackrealign-attribute.md

Co-authored-by: Jacob Lifshay <programmerjake@gmail.com>
This commit is contained in:
benisxdxd 2024-03-31 20:51:15 +03:00 committed by GitHub
parent 44dc5e88ec
commit 78f5c71380
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ The realign_stack attribute is specified as follows:
#[realign_stack]
```
When the `realign_stack` attribute is applied to a function, the compiler ensures that the stack is aligned to the "natural alligmnet" specified in the Data Layout that LLVM uses before executing the function's body.
When the `realign_stack` attribute is applied to a function, the compiler no longer assumes the stack is properly aligned when the function is called, so will insert code to align the stack as needed for calling other functions, variables requiring alignment, etc.
This alignment is achieved by adjusting the stack pointer accordingly. The alignment is maintained for the duration of the function's execution.