mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Add a stack_size_and_alignment method to Layout
This commit is contained in:
parent
11118bb555
commit
031dce61c9
1 changed files with 8 additions and 0 deletions
|
@ -846,6 +846,14 @@ impl<'a> Layout<'a> {
|
|||
round_up_to_alignment(width, alignment)
|
||||
}
|
||||
|
||||
pub fn stack_size_and_alignment(&self, pointer_size: u32) -> (u32, u32) {
|
||||
let width = self.stack_size_without_alignment(pointer_size);
|
||||
let alignment = self.alignment_bytes(pointer_size);
|
||||
|
||||
let size = round_up_to_alignment(width, alignment);
|
||||
(size, alignment)
|
||||
}
|
||||
|
||||
fn stack_size_without_alignment(&self, pointer_size: u32) -> u32 {
|
||||
use Layout::*;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue