Memory optimization for the general case by reserving significantly fewer tokens in lexer. It was reserving 1 million always!

This commit is contained in:
2025-09-11 12:27:44 +02:00
parent 361a310ed1
commit d6ea2e4c2f
6 changed files with 6 additions and 2 deletions

View File

@@ -577,7 +577,7 @@ lex :: (ctx : *Compiler_Context, allocator := temp) {
lexer : Lexer;
lexer.ctx = ctx;
array_reserve(*lexer.ctx.tokens, 1024 * 1024);
array_reserve(*lexer.ctx.tokens, 1024);
init_lexer_from_string(*lexer, ctx.file.source);
lexer.path = ctx.file.path;