Add mutex guards for signature scopes

This commit is contained in:
gingerBill
2022-01-10 14:50:28 +00:00
parent 6f3e450c50
commit 7cc265e14c
7 changed files with 68 additions and 14 deletions

View File

@@ -77,15 +77,19 @@ template <typename T> Slice<T> slice_from_array(Array<T> const &a);
template <typename T>
Slice<T> slice_make(gbAllocator const &allocator, isize count) {
GB_ASSERT(count >= 0);
Slice<T> s = {};
s.data = gb_alloc_array(allocator, T, count);
GB_ASSERT(s.data != nullptr);
s.count = count;
return s;
}
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);
s->count = count;
}