From a58868fbab56f495aed96c3e5341a78ab5d0727f Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 4 Jan 2021 09:40:54 -0600 Subject: [PATCH] raw_alloc and raw_resize can take an alignment argument --- core/builtin.onyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/builtin.onyx b/core/builtin.onyx index 9e4dbeb8..643ecede 100644 --- a/core/builtin.onyx +++ b/core/builtin.onyx @@ -56,12 +56,12 @@ Allocator :: struct { func: allocator_proc; } -raw_alloc :: proc (use a: Allocator, size: u32) -> rawptr { - return func(data, AllocationAction.Alloc, size, __DEFAULT_ALLOCATION_ALIGNMENT, null); +raw_alloc :: proc (use a: Allocator, size: u32, alignment := __DEFAULT_ALLOCATION_ALIGNMENT) -> rawptr { + return func(data, AllocationAction.Alloc, size, alignment, null); } -raw_resize :: proc (use a: Allocator, ptr: rawptr, size: u32) -> rawptr { - return func(data, AllocationAction.Resize, size, __DEFAULT_ALLOCATION_ALIGNMENT, ptr); +raw_resize :: proc (use a: Allocator, ptr: rawptr, size: u32, alignment := __DEFAULT_ALLOCATION_ALIGNMENT) -> rawptr { + return func(data, AllocationAction.Resize, size, alignment, ptr); } raw_free :: proc (use a: Allocator, ptr: rawptr) { -- 2.25.1