default_allocators_general.odin 471 B

1234567891011121314151617181920
  1. //+build !windows
  2. //+build !freestanding
  3. //+build !wasi
  4. //+build !js
  5. package runtime
  6. when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
  7. // mem.nil_allocator reimplementation
  8. default_allocator_proc :: nil_allocator_proc
  9. default_allocator :: nil_allocator
  10. } else {
  11. // TODO(bill): reimplement these procedures in the os_specific stuff
  12. import "core:os"
  13. default_allocator_proc :: os.heap_allocator_proc
  14. default_allocator :: proc() -> Allocator {
  15. return os.heap_allocator()
  16. }
  17. }