From 3049e07f72f51fd9868066c602dbca922643cfb0 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 21 May 2022 13:30:09 +0100 Subject: [PATCH] Add `mem.DEFAULT_PAGE_SIZE` --- core/mem/alloc.odin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/mem/alloc.odin b/core/mem/alloc.odin index bdd2899a9..4e439ac39 100644 --- a/core/mem/alloc.odin +++ b/core/mem/alloc.odin @@ -55,6 +55,11 @@ Allocator :: struct { DEFAULT_ALIGNMENT :: 2*align_of(rawptr) +DEFAULT_PAGE_SIZE :: + 64 * 1024 when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64 else + 16 * 1024 when ODIN_OS == .darwin && ODIN_ARCH == .arm64 else + 4 * 1024 + alloc :: proc(size: int, alignment: int = DEFAULT_ALIGNMENT, allocator := context.allocator, loc := #caller_location) -> rawptr { if size == 0 { return nil