mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Fixes WasmAllocator to reflect recent nightly API changes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user