Many renames.

- Everything polkadot becomes polkadot-.
- Wasm (substrate) executor tests split from Wasm (Polkadot) runtime and
built independently.
This commit is contained in:
Gav
2018-02-07 23:36:34 +01:00
parent 3d0a44c8a9
commit 5c842f77bc
453 changed files with 3230 additions and 90 deletions
+36
View File
@@ -0,0 +1,36 @@
#![warn(missing_docs)]
#![cfg_attr(feature = "strict", deny(warnings))]
#![no_std]
#![crate_type = "rlib"]
#![cfg_attr(feature = "nightly", feature(global_allocator))]
#![cfg_attr(feature = "nightly", feature(alloc))]
#![cfg_attr(feature = "nightly", feature(allocator_api))]
//! Custom allocator crate for wasm
/// Wasm allocator
pub struct WasmAllocator;
#[cfg(feature = "nightly")]
#[global_allocator]
static ALLOCATOR: WasmAllocator = WasmAllocator;
#[cfg(feature = "nightly")]
mod __impl {
extern crate alloc;
extern crate pwasm_libc;
use self::alloc::heap::{Alloc, Layout, AllocErr};
use super::WasmAllocator;
unsafe impl<'a> Alloc for &'a WasmAllocator {
unsafe fn alloc(&mut self, layout: Layout) -> Result<*mut u8, AllocErr> {
Ok(pwasm_libc::malloc(layout.size()))
}
unsafe fn dealloc(&mut self, ptr: *mut u8, _layout: Layout) {
pwasm_libc::free(ptr)
}
}
}