Improve some docs and misc code segments

This commit is contained in:
Mark McCaskey
2020-01-31 15:42:18 -08:00
parent a01fd4cafb
commit 929825cba1
6 changed files with 21 additions and 14 deletions

View File

@ -1,5 +1,5 @@
//! The global module contains the implementation data structures and helper functions used to
//! manipulate and access a wasm globals.
//! The global module contains data structures and helper functions used to
//! manipulate and access Wasm globals.
use crate::{
export::Export,
import::IsExport,
@ -11,7 +11,7 @@ use std::{
sync::{Arc, Mutex},
};
/// Container with a descriptor and a reference to a global value.
/// A handle to a Wasm Global
pub struct Global {
desc: GlobalDescriptor,
storage: Arc<Mutex<vm::LocalGlobal>>,

View File

@ -1,15 +1,15 @@
//! Wasmer Runtime Core Library
//!
//! The runtime core library provides common data structures which are shared by compiler backends
//! to implement a Web Assembly runtime.
//! This crate provides common data structures which are shared by compiler backends
//! to implement a WebAssembly runtime.
//!
//! The runtime core also provides an API for users who use wasmer as an embedded wasm runtime which
//! This crate also provides an API for users who use wasmer as an embedded wasm runtime which
//! allows operations like compiling, instantiating, providing imports, access exports, memories,
//! and tables for example.
//!
//! The runtime core library is recommended to be used by only power users who wish to customize the
//! wasmer runtime. Most wasmer users should prefer the API which is re-exported by the wasmer
//! runtime library which provides common defaults and a friendly API.
//! Most wasmer users should prefer the API which is re-exported by the `wasmer-runtime`
//! library by default. This crate provides additional APIs which may be useful to users
//! that wish to customize the wasmer runtime.
//!
#![deny(

View File

@ -88,7 +88,7 @@ impl Instance for LocalInstance {
}
}
let offset = self.offsets[id];
let addr: *const u8 = unsafe { self.code.as_ptr().offset(offset as isize) };
let addr: *const u8 = unsafe { self.code.as_ptr().add(offset) };
use std::mem::transmute;
Ok(unsafe {
match args_u64.len() {

View File

@ -658,7 +658,7 @@ macro_rules! impl_traits {
Rets: WasmTypeList,
{
/// Call the typed func and return results.
#[allow(non_snake_case)]
#[allow(non_snake_case, clippy::too_many_arguments)]
pub fn call(&self, $( $x: $x, )* ) -> Result<Rets, RuntimeError> {
#[allow(unused_parens)]
unsafe {