mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Rename CodeSection serializer, since it doesn't actually mutate
This commit is contained in:
parent
01b47a2ec7
commit
e5a0738681
1 changed files with 4 additions and 4 deletions
|
@ -452,15 +452,15 @@ impl<'a> CodeSection<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Serialize the code builders for all functions, and get code relocations with final offsets
|
/// Serialize the code builders for all functions, and get code relocations with final offsets
|
||||||
pub fn serialize_mut<T: SerialBuffer>(
|
pub fn serialize_with_relocs<T: SerialBuffer>(
|
||||||
&mut self,
|
&self,
|
||||||
buffer: &mut T,
|
buffer: &mut T,
|
||||||
relocations: &mut Vec<'a, RelocationEntry>,
|
relocations: &mut Vec<'a, RelocationEntry>,
|
||||||
) {
|
) {
|
||||||
let header_indices = write_section_header(buffer, SectionId::Code);
|
let header_indices = write_section_header(buffer, SectionId::Code);
|
||||||
buffer.encode_u32(self.code_builders.len() as u32);
|
buffer.encode_u32(self.code_builders.len() as u32);
|
||||||
|
|
||||||
for code_builder in self.code_builders.iter_mut() {
|
for code_builder in self.code_builders.iter() {
|
||||||
code_builder.serialize_with_relocs(buffer, relocations, header_indices.body_index);
|
code_builder.serialize_with_relocs(buffer, relocations, header_indices.body_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -657,7 +657,7 @@ impl<'a> WasmModule<'a> {
|
||||||
// Code section mutates its linker relocation data during serialization
|
// Code section mutates its linker relocation data during serialization
|
||||||
let code_section_index = counter.section_index;
|
let code_section_index = counter.section_index;
|
||||||
self.code
|
self.code
|
||||||
.serialize_mut(buffer, &mut self.reloc_code.entries);
|
.serialize_with_relocs(buffer, &mut self.reloc_code.entries);
|
||||||
counter.update(buffer);
|
counter.update(buffer);
|
||||||
|
|
||||||
// Data section is the last one before linking, so we can stop counting
|
// Data section is the last one before linking, so we can stop counting
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue