summaryrefslogtreecommitdiff
path: root/src/array.cc
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-03-02 12:45:50 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-03-02 12:45:50 +0100
commitf8f8d483f62cfabdada34c2b24509bbe457e87ef (patch)
treeb824bf42c2427b0f2d83a4a35332942a097bd995 /src/array.cc
parent01fe9f2eeab8b54487a4673e74851160adb1718d (diff)
working on array and fixing errors
Diffstat (limited to 'src/array.cc')
-rw-r--r--src/array.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/array.cc b/src/array.cc
index 7c8cc19..06b79c2 100644
--- a/src/array.cc
+++ b/src/array.cc
@@ -12,13 +12,14 @@ struct Array {
const Allocator* allocator;
};
-#define array_init(T, allocator) Array<T>{Slice<T>{}, allocator}
+#define array_init(T, allocator) \
+ Array<T> { Slice<T>{}, allocator }
-template<typename T>
+template <typename T>
void array_deinit(Array<T>* array) {
assert(array != nullptr);
- if(unlikely(array->allocator == nullptr)) return;
+ if (unlikely(array->allocator == nullptr)) return;
slice_deallocate(array->allocator, &array->buffer);
array->allocator = nullptr;