Begin optimizing tokenizer; Replace gb_utf8_decode with utf8_decode (CC but easier to change later)

This commit is contained in:
gingerBill
2021-08-01 23:56:17 +01:00
parent b1a8357f50
commit be76da2c90
9 changed files with 169 additions and 44 deletions
+3 -1
View File
@@ -8232,7 +8232,9 @@ gbFileContents gb_file_read_contents(gbAllocator a, b32 zero_terminate, char con
if (gb_file_open(&file, filepath) == gbFileError_None) {
isize file_size = cast(isize)gb_file_size(&file);
if (file_size > 0) {
result.data = gb_alloc(a, zero_terminate ? file_size+1 : file_size);
isize total_size = file_size + !!zero_terminate;
total_size = (total_size+7)&~7;
result.data = gb_alloc(a, total_size);
result.size = file_size;
gb_file_read_at(&file, result.data, result.size, 0);
if (zero_terminate) {