Memory optimization for the general case by reserving significantly fewer tokens in lexer. It was reserving 1 million always!
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user