Skip to content
Snippets Groups Projects
Commit e6c7149f authored by Dmitry Kashitsyn's avatar Dmitry Kashitsyn
Browse files

Fixes WasmAllocator to reflect recent nightly API changes

parent 4dc6af80
No related merge requests found
......@@ -20,16 +20,16 @@ mod __impl {
extern crate alloc;
extern crate pwasm_libc;
use self::alloc::heap::{GlobalAlloc, Layout, Opaque};
use core::alloc::{GlobalAlloc, Layout};
use super::WasmAllocator;
unsafe impl GlobalAlloc for WasmAllocator {
unsafe fn alloc(&self, layout: Layout) -> *mut Opaque {
pwasm_libc::malloc(layout.size()) as *mut Opaque
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
pwasm_libc::malloc(layout.size()) as *mut u8
}
unsafe fn dealloc(&self, ptr: *mut Opaque, _layout: Layout) {
unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {
pwasm_libc::free(ptr as *mut u8)
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment