Use templated Array with bounds checking

This commit is contained in:
Ginger Bill
2017-06-08 12:54:52 +01:00
parent 13deb4706c
commit 2a89d8021c
17 changed files with 689 additions and 686 deletions

View File

@@ -338,7 +338,7 @@ typedef struct Tokenizer {
isize line_count;
isize error_count;
Array(String) allocated_strings;
Array<String> allocated_strings;
} Tokenizer;
@@ -460,7 +460,7 @@ gb_inline void destroy_tokenizer(Tokenizer *t) {
gb_free(heap_allocator(), t->start);
}
for_array(i, t->allocated_strings) {
gb_free(heap_allocator(), t->allocated_strings.e[i].text);
gb_free(heap_allocator(), t->allocated_strings[i].text);
}
array_free(&t->allocated_strings);
}