Remove core:os dependency for base:runtime

This commit is contained in:
gingerBill
2024-01-28 22:40:46 +00:00
parent eee8e0faa2
commit 9a16bc5fc5
19 changed files with 200 additions and 118 deletions
+2 -18
View File
@@ -1,28 +1,12 @@
//+build !windows
//+build !freestanding
//+build !wasi
//+build !js
package runtime
// TODO(bill): reimplement these procedures in the os_specific stuff
import "core:os"
when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
_ :: os
// mem.nil_allocator reimplementation
default_allocator_proc :: nil_allocator_proc
default_allocator :: nil_allocator
} else when ODIN_DEFAULT_TO_PANIC_ALLOCATOR {
_ :: os
default_allocator_proc :: panic_allocator_proc
default_allocator :: panic_allocator
} else {
default_allocator_proc :: os.heap_allocator_proc
default_allocator :: proc() -> Allocator {
return os.heap_allocator()
}
default_allocator :: heap_allocator
default_allocator_proc :: heap_allocator_proc
}