Fix -target:js_wasm32 for core:runtime

This commit is contained in:
gingerBill
2021-06-08 11:20:39 +01:00
parent 9491c13a5c
commit 16eaa17ed9
6 changed files with 90 additions and 67 deletions
+17
View File
@@ -0,0 +1,17 @@
//+build freestanding, js
package runtime
// mem.nil_allocator reimplementation
default_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
size, alignment: int,
old_memory: rawptr, old_size: int, loc := #caller_location) -> ([]byte, Allocator_Error) {
return nil, .None;
}
default_allocator :: proc() -> Allocator {
return Allocator{
procedure = default_allocator_proc,
data = nil,
};
}