add a default heap/general purpose allocator for wasm to base:runtime

This commit is contained in:
Laytan Laats
2024-05-16 23:08:40 +02:00
parent f9fd8f0c25
commit f42b1c4973
6 changed files with 906 additions and 13 deletions
@@ -6,6 +6,9 @@ when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
} else when ODIN_DEFAULT_TO_PANIC_ALLOCATOR {
default_allocator_proc :: panic_allocator_proc
default_allocator :: panic_allocator
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
default_allocator :: default_wasm_allocator
default_allocator_proc :: wasm_allocator_proc
} else {
default_allocator :: heap_allocator
default_allocator_proc :: heap_allocator_proc