mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 05:38:19 +00:00
Make FunctionBodyPtr a thin pointer.
This requires keeping the length around and passing it around in a few places that need it.
This commit is contained in:
@@ -58,13 +58,13 @@ pub use crate::vmoffsets::{TargetSharedSignatureIndex, VMOffsets};
|
||||
/// Version number of this crate.
|
||||
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
/// A safe wrapper around `VMFunctionBody`
|
||||
/// A safe wrapper around `VMFunctionBody`.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[repr(transparent)]
|
||||
pub struct FunctionBodyPtr(pub *const [VMFunctionBody]);
|
||||
pub struct FunctionBodyPtr(pub *const VMFunctionBody);
|
||||
|
||||
impl std::ops::Deref for FunctionBodyPtr {
|
||||
type Target = *const [VMFunctionBody];
|
||||
type Target = *const VMFunctionBody;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
|
||||
Reference in New Issue
Block a user