aboutsummaryrefslogtreecommitdiff
path: root/src/array.cpp
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-07-28 16:01:18 +0200
committerGitHub <noreply@github.com>2022-07-28 16:01:18 +0200
commit674ebe395f1feba70becaac75c4fb9451f74f84c (patch)
tree78589612bd458269904d53de46d0accf4f58a7af /src/array.cpp
parent9746e25784c208cf8a7883bcb2e1ac2317117aeb (diff)
parent96eecaab54cea02499e9cf418aa39eb5a9c9ec75 (diff)
Merge branch 'master' into master
Diffstat (limited to 'src/array.cpp')
-rw-r--r--src/array.cpp4
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;
}