From 7cc265e14ce3ec08a5908d31441000bdcb4ac645 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 10 Jan 2022 14:50:28 +0000 Subject: Add mutex guards for signature scopes --- src/array.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/array.cpp') diff --git a/src/array.cpp b/src/array.cpp index c41125c6d..ac3727978 100644 --- a/src/array.cpp +++ b/src/array.cpp @@ -77,15 +77,19 @@ template Slice slice_from_array(Array const &a); template Slice slice_make(gbAllocator const &allocator, isize count) { + GB_ASSERT(count >= 0); Slice s = {}; s.data = gb_alloc_array(allocator, T, count); + GB_ASSERT(s.data != nullptr); s.count = count; return s; } template void slice_init(Slice *s, gbAllocator const &allocator, isize count) { + GB_ASSERT(count >= 0); s->data = gb_alloc_array(allocator, T, count); + GB_ASSERT(s->data != nullptr); s->count = count; } -- cgit v1.2.3