From 557adb6ed9fde73812ad6e474a4f105891da0c1e Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Wed, 9 Oct 2024 12:45:50 +0200 Subject: [PATCH] Update the init function of the arena allocator. --- lib/std/core/allocators/arena_allocator.c3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/core/allocators/arena_allocator.c3 b/lib/std/core/allocators/arena_allocator.c3 index 84a6cd026..70dcd68b7 100644 --- a/lib/std/core/allocators/arena_allocator.c3 +++ b/lib/std/core/allocators/arena_allocator.c3 @@ -13,10 +13,11 @@ struct ArenaAllocator (Allocator) /** * Initialize a memory arena for use using the provided bytes. **/ -fn void ArenaAllocator.init(&self, char[] data) +fn ArenaAllocator* ArenaAllocator.init(&self, char[] data) { self.data = data; self.used = 0; + return self; } fn void ArenaAllocator.clear(&self)