aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-03-16 20:01:42 +0800
committerMistivia <i@mistivia.com>2025-03-16 20:01:42 +0800
commitb83187f66175d93a0dba45f6d110ed94badac7c5 (patch)
tree22710b7a5278ac8a254ead30109f1dd9084d1022 /src/utils.h
parent1ce0d45242097a07b7a4ee539a074ec812851a58 (diff)
refactor using allocator pattern
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
new file mode 100644
index 0000000..af5e820
--- /dev/null
+++ b/src/utils.h
@@ -0,0 +1,14 @@
+#ifndef FVM_UTILS_H_
+#define FVM_UTILS_H_
+
+#include <stdlib.h>
+
+struct allocator;
+typedef struct allocator *Allocator;
+
+Allocator newAllocator();
+void deleteAllocator(Allocator allocator);
+
+void* allocate(Allocator allocator, size_t size);
+
+#endif // FVM_UTILS_H_