mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
refactor stack pointer initialisation
This commit is contained in:
parent
baf896f6f9
commit
d8c1017aec
2 changed files with 20 additions and 10 deletions
|
@ -224,11 +224,15 @@ impl Serialize for Import {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct ImportSection<'a> { entries: Vec<'a, Import> }
|
||||
pub struct ImportSection<'a> {
|
||||
entries: Vec<'a, Import>,
|
||||
}
|
||||
|
||||
impl<'a> ImportSection<'a> {
|
||||
pub fn new(arena: &'a Bump) -> Self {
|
||||
ImportSection { entries: bumpalo::vec![in arena] }
|
||||
ImportSection {
|
||||
entries: bumpalo::vec![in arena],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -303,6 +307,15 @@ impl MemorySection {
|
|||
MemorySection(Some(Limits::Min(pages)))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn min_size(&self) -> Option<u32> {
|
||||
match self {
|
||||
MemorySection(Some(Limits::Min(min))) | MemorySection(Some(Limits::MinMax(min, _))) => {
|
||||
Some(min * Self::PAGE_SIZE)
|
||||
}
|
||||
MemorySection(None) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for MemorySection {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue