commit 50333fa221b728256102c0ff3ef7a93166e53841
parent 102aa58ebfdc93faff8397c578fbef465877d6ec
Author: thing1 <thing1@seacrossedlovers.xyz>
Date: Tue, 12 May 2026 17:53:17 +0100
started work on arena
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/allocate/alloc.ha b/allocate/alloc.ha
@@ -0,0 +1,12 @@
+export type createfn = fn(_: allocator, _: *opaque) (*opaque | nomem);
+export type destroyfn = fn(_: allocator, _: *opaque) void;
+
+export type vtable = struct {
+ create: *createfn,
+ destroy: *destroyfn
+};
+
+export type allocator = *vtable;
+
+export fn create(al: allocator, obj: *opaque) (*opaque | nomem) = al.create(al, obj);
+export fn destroy(al: allocator, obj: *opaque) (*opaque | nomem) = al.destroy(al, obj);