mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +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
|
||||
pub fn serialize_mut<T: SerialBuffer>(
|
||||
&mut self,
|
||||
pub fn serialize_with_relocs<T: SerialBuffer>(
|
||||
&self,
|
||||
buffer: &mut T,
|
||||
relocations: &mut Vec<'a, RelocationEntry>,
|
||||
) {
|
||||
let header_indices = write_section_header(buffer, SectionId::Code);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -657,7 +657,7 @@ impl<'a> WasmModule<'a> {
|
|||
// Code section mutates its linker relocation data during serialization
|
||||
let code_section_index = counter.section_index;
|
||||
self.code
|
||||
.serialize_mut(buffer, &mut self.reloc_code.entries);
|
||||
.serialize_with_relocs(buffer, &mut self.reloc_code.entries);
|
||||
counter.update(buffer);
|
||||
|
||||
// Data section is the last one before linking, so we can stop counting
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue