(
memory: &mut dyn JITMemoryProvider,
size: usize,
align: u64,
relocs: Vec<ModuleReloc>,
#[cfg(feature = "wasmtime-unwinder")] wasmtime_exception_data: Option<V
| 65 | } |
| 66 | |
| 67 | pub(crate) fn new_zeroed( |
| 68 | memory: &mut dyn JITMemoryProvider, |
| 69 | size: usize, |
| 70 | align: u64, |
| 71 | relocs: Vec<ModuleReloc>, |
| 72 | #[cfg(feature = "wasmtime-unwinder")] wasmtime_exception_data: Option<Vec<u8>>, |
| 73 | kind: JITMemoryKind, |
| 74 | ) -> ModuleResult<Self> { |
| 75 | let ptr = memory |
| 76 | .allocate(size, align, kind) |
| 77 | .map_err(|e| ModuleError::Allocation { err: e })?; |
| 78 | |
| 79 | unsafe { ptr::write_bytes(ptr, 0, size) }; |
| 80 | |
| 81 | Ok(CompiledBlob { |
| 82 | ptr, |
| 83 | size, |
| 84 | relocs, |
| 85 | veneer_count: 0, |
| 86 | #[cfg(feature = "wasmtime-unwinder")] |
| 87 | wasmtime_exception_data, |
| 88 | }) |
| 89 | } |
| 90 | |
| 91 | pub(crate) fn ptr(&self) -> *const u8 { |
| 92 | self.ptr |
nothing calls this directly
no test coverage detected