diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-02 12:45:50 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-02 12:45:50 +0100 |
| commit | f8f8d483f62cfabdada34c2b24509bbe457e87ef (patch) | |
| tree | b824bf42c2427b0f2d83a4a35332942a097bd995 /src/array.cc | |
| parent | 01fe9f2eeab8b54487a4673e74851160adb1718d (diff) | |
working on array and fixing errors
Diffstat (limited to 'src/array.cc')
| -rw-r--r-- | src/array.cc | 7 |
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; |
