Add -show-timings; Clean up polymorphic procedure code a bit

This commit is contained in:
Ginger Bill
2017-07-07 15:26:49 +01:00
parent 2db03cb4a5
commit 773cf5ca08
7 changed files with 373 additions and 275 deletions

View File

@@ -10,12 +10,12 @@ struct Array {
isize capacity;
T &operator[](isize index) {
GB_ASSERT_MSG(0 <= index && index < count, "Index out of bounds");
GB_ASSERT_MSG(0 <= index && index < count, "Index %td is out of bounds ranges 0..<%td", index, count);
return data[index];
}
T const &operator[](isize index) const {
GB_ASSERT_MSG(0 <= index && index < count, "Index out of bounds");
GB_ASSERT_MSG(0 <= index && index < count, "Index %td is out of bounds ranges 0..<%td", index, count);
return data[index];
}
};
@@ -31,7 +31,6 @@ template <typename T> void array_reserve (Array<T> *array, isize capacit
template <typename T> void array_resize (Array<T> *array, isize count);
template <typename T> void array_set_capacity(Array<T> *array, isize capacity);
template <typename T>
void array_init(Array<T> *array, gbAllocator a, isize init_capacity) {
array->allocator = a;