Make more code work with no_std. (#407)

* Make more code work with no_std.

no_std support is still incomplete, but this patch takes care of the
bulk of the straightforward parts.
This commit is contained in:
Dan Gohman
2019-10-08 16:53:32 -07:00
committed by GitHub
parent c0b37bb713
commit 8e1b44b29c
100 changed files with 380 additions and 270 deletions

View File

@@ -1,11 +1,13 @@
//! Support for a calling of a bounds (exported) function.
extern crate alloc;
use pyo3::prelude::*;
use pyo3::types::PyTuple;
use crate::value::{pyobj_to_value, value_to_pyobj};
use std::cell::RefCell;
use std::rc::Rc;
use alloc::rc::Rc;
use core::cell::RefCell;
use cranelift_codegen::ir;
use wasmtime_interface_types::ModuleData;

View File

@@ -1,5 +1,7 @@
//! Support for a calling of an imported function.
extern crate alloc;
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyDict, PyTuple};
@@ -18,10 +20,10 @@ use target_lexicon::HOST;
use wasmtime_environ::{Export, Module};
use wasmtime_runtime::{Imports, InstanceHandle, VMContext, VMFunctionBody};
use alloc::rc::Rc;
use core::cell::RefCell;
use core::cmp;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::rc::Rc;
struct BoundPyFunction {
name: String,

View File

@@ -1,12 +1,14 @@
//! WebAssembly Instance API object.
extern crate alloc;
use pyo3::prelude::*;
use pyo3::types::PyDict;
use crate::function::Function;
use crate::memory::Memory;
use std::cell::RefCell;
use std::rc::Rc;
use alloc::rc::Rc;
use core::cell::RefCell;
use cranelift_codegen::ir;
use cranelift_codegen::ir::types;

View File

@@ -7,7 +7,7 @@ use crate::import::into_instance_from_obj;
use crate::instance::Instance;
use crate::memory::Memory;
use crate::module::Module;
use std::cell::RefCell;
use core::cell::RefCell;
use std::rc::Rc;
use wasmtime_interface_types::ModuleData;

View File

@@ -1,15 +1,17 @@
//! WebAssembly Memory API object.
extern crate alloc;
use pyo3::class::PyBufferProtocol;
use pyo3::exceptions::BufferError;
use pyo3::ffi;
use pyo3::prelude::*;
use std::cell::RefCell;
use alloc::rc::Rc;
use core::cell::RefCell;
use core::ptr;
use std::ffi::CStr;
use std::os::raw::{c_int, c_void};
use std::ptr;
use std::rc::Rc;
use wasmtime_environ::MemoryPlan;
use wasmtime_jit::{Context, InstanceHandle};

View File

@@ -1,8 +1,10 @@
//! WebAssembly Module API object.
extern crate alloc;
use pyo3::prelude::*;
use std::rc::Rc;
use alloc::rc::Rc;
#[pyclass]
pub struct Module {

View File

@@ -4,8 +4,8 @@ use pyo3::exceptions::Exception;
use pyo3::prelude::*;
use pyo3::types::PyAny;
use core::ptr;
use cranelift_codegen::ir;
use std::ptr;
use wasmtime_interface_types::Value;
pub fn pyobj_to_value(_: Python, p: &PyAny) -> PyResult<Value> {