diff options
| author | gingerBill <bill@gingerbill.org> | 2022-02-18 21:30:25 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-02-18 21:30:25 +0000 |
| commit | 71df46456a4db2592e8cebbdd4c46dc8b58b5a24 (patch) | |
| tree | 4152775ac24721cd026025d1e478d2eb9a254b41 /src/array.cpp | |
| parent | cd89d8a3c414a6929ec058a04aeec568d99505a5 (diff) | |
Minimize memory usage by having an arena per thread rather than an arena per file
Diffstat (limited to 'src/array.cpp')
| -rw-r--r-- | src/array.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/array.cpp b/src/array.cpp index ac3727978..d08bd647f 100644 --- a/src/array.cpp +++ b/src/array.cpp @@ -89,7 +89,9 @@ template <typename T> void slice_init(Slice<T> *s, gbAllocator const &allocator, isize count) { GB_ASSERT(count >= 0); s->data = gb_alloc_array(allocator, T, count); - GB_ASSERT(s->data != nullptr); + if (count > 0) { + GB_ASSERT(s->data != nullptr); + } s->count = count; } |