From d1fa640549c36c650f81b24f616db039aaf49ea4 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sun, 11 Jan 2026 20:07:54 +0100 Subject: [PATCH] runtime: use `alloc_non_zeroed` in `new_clone`; zeroing is not needed --- base/runtime/core_builtin.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/runtime/core_builtin.odin b/base/runtime/core_builtin.odin index 6fecbaad9..42bf13478 100644 --- a/base/runtime/core_builtin.odin +++ b/base/runtime/core_builtin.odin @@ -360,7 +360,7 @@ new_aligned :: proc($T: typeid, alignment: int, allocator := context.allocator, @(builtin, require_results) new_clone :: proc(data: $T, allocator := context.allocator, loc := #caller_location) -> (t: ^T, err: Allocator_Error) #optional_allocator_error { - t = (^T)(raw_data(mem_alloc_bytes(size_of(T), align_of(T), allocator, loc) or_return)) + t = (^T)(raw_data(mem_alloc_non_zeroed(size_of(T), align_of(T), allocator, loc) or_return)) if t != nil { t^ = data }