Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix build from nightly API change.
  • Loading branch information
gavofyork committed Apr 15, 2018
commit 921d7c4c5d473c6cfefe0b8316fcff7236bcf7b6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions substrate/pwasm-alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ mod __impl {
extern crate alloc;
extern crate pwasm_libc;

use self::alloc::heap::{Alloc, Layout, AllocErr};
use self::alloc::heap::{GlobalAlloc, Layout, Opaque};

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 impl GlobalAlloc for WasmAllocator {
unsafe fn alloc(&self, layout: Layout) -> *mut Opaque {
pwasm_libc::malloc(layout.size()) as *mut Opaque
}

unsafe fn dealloc(&mut self, ptr: *mut u8, _layout: Layout) {
pwasm_libc::free(ptr)
unsafe fn dealloc(&self, ptr: *mut Opaque, _layout: Layout) {
pwasm_libc::free(ptr as *mut u8)
}
}
}
Binary file not shown.
Binary file not shown.