diff options
Diffstat (limited to 'core/mem')
| -rw-r--r-- | core/mem/allocators.odin | 2 | ||||
| -rw-r--r-- | core/mem/mem.odin | 10 | ||||
| -rw-r--r-- | core/mem/virtual/arena.odin | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin index fc009621b..66da12959 100644 --- a/core/mem/allocators.odin +++ b/core/mem/allocators.odin @@ -153,7 +153,7 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, s := (^Scratch_Allocator)(allocator_data) if s.data == nil { - DEFAULT_BACKING_SIZE :: 1<<22 + DEFAULT_BACKING_SIZE :: 4 * Megabyte if !(context.allocator.procedure != scratch_allocator_proc && context.allocator.data != allocator_data) { panic("cyclic initialization of the scratch allocator with itself") diff --git a/core/mem/mem.odin b/core/mem/mem.odin index f7be69adc..bc77ca287 100644 --- a/core/mem/mem.odin +++ b/core/mem/mem.odin @@ -3,11 +3,11 @@ package mem import "core:runtime" import "core:intrinsics" -Byte :: 1 -Kilobyte :: 1024 * Byte -Megabyte :: 1024 * Kilobyte -Gigabyte :: 1024 * Megabyte -Terabyte :: 1024 * Gigabyte +Byte :: runtime.Byte +Kilobyte :: runtime.Kilobyte +Megabyte :: runtime.Megabyte +Gigabyte :: runtime.Gigabyte +Terabyte :: runtime.Terabyte set :: proc "contextless" (data: rawptr, value: byte, len: int) -> rawptr { return runtime.memset(data, i32(value), len) diff --git a/core/mem/virtual/arena.odin b/core/mem/virtual/arena.odin index e901cf6f3..0ddb116fd 100644 --- a/core/mem/virtual/arena.odin +++ b/core/mem/virtual/arena.odin @@ -19,11 +19,11 @@ Arena :: struct { // 1 MiB should be enough to start with -DEFAULT_ARENA_STATIC_COMMIT_SIZE :: 1<<20 +DEFAULT_ARENA_STATIC_COMMIT_SIZE :: mem.Megabyte DEFAULT_ARENA_GROWING_MINIMUM_BLOCK_SIZE :: DEFAULT_ARENA_STATIC_COMMIT_SIZE // 1 GiB on 64-bit systems, 128 MiB on 32-bit systems by default -DEFAULT_ARENA_STATIC_RESERVE_SIZE :: 1<<30 when size_of(uintptr) == 8 else 1<<27 +DEFAULT_ARENA_STATIC_RESERVE_SIZE :: mem.Gigabyte when size_of(uintptr) == 8 else 128 * mem.Megabyte |