Wasm: Convert remaining sections to store bytes, and add .size() methods

This commit is contained in:
Brian Carroll 2022-01-08 18:23:09 +00:00
parent f4ac5bffa3
commit 5d5e0eca96
5 changed files with 154 additions and 54 deletions

View file

@ -476,6 +476,10 @@ impl<'a> CodeBuilder<'a> {
***********************************************************/
pub fn size(&self) -> usize {
self.inner_length.len() + self.preamble.len() + self.code.len() + self.insert_bytes.len()
}
/// Serialize all byte vectors in the right order
/// Also update relocation offsets relative to the base offset (code section body start)
pub fn serialize_without_relocs<T: SerialBuffer>(&self, buffer: &mut T) {