Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
This commit is contained in:
parent
c3a1c023c0
commit
be6708428f
24 changed files with 445 additions and 527 deletions
|
@ -40,6 +40,12 @@ impl Deref for Mmap {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for Mmap {
|
||||
fn as_ref(&self) -> &[u8] {
|
||||
&*self.0
|
||||
}
|
||||
}
|
||||
|
||||
// SAFETY: On architectures other than WASM, mmap is used as backing storage. The address of this
|
||||
// memory map is stable. On WASM, `Vec<u8>` is used as backing storage. The `Mmap` type doesn't
|
||||
// export any function that can cause the `Vec` to be re-allocated. As such the address of the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue