aboutsummaryrefslogtreecommitdiff
path: root/core/runtime/default_allocators_general.odin
blob: 994a672b0ab063464485ee711e8a765d3ac090f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//+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 {

	default_allocator_proc :: os.heap_allocator_proc

	default_allocator :: proc() -> Allocator {
		return os.heap_allocator()
	}
}