mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Add mem.DEFAULT_PAGE_SIZE
This commit is contained in:
@@ -55,6 +55,11 @@ Allocator :: struct {
|
|||||||
|
|
||||||
DEFAULT_ALIGNMENT :: 2*align_of(rawptr)
|
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 {
|
alloc :: proc(size: int, alignment: int = DEFAULT_ALIGNMENT, allocator := context.allocator, loc := #caller_location) -> rawptr {
|
||||||
if size == 0 {
|
if size == 0 {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user