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 : Lexer;
|
||||||
lexer.ctx = ctx;
|
lexer.ctx = ctx;
|
||||||
array_reserve(*lexer.ctx.tokens, 1024 * 1024);
|
array_reserve(*lexer.ctx.tokens, 1024);
|
||||||
|
|
||||||
init_lexer_from_string(*lexer, ctx.file.source);
|
init_lexer_from_string(*lexer, ctx.file.source);
|
||||||
lexer.path = ctx.file.path;
|
lexer.path = ctx.file.path;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
test/assign_arithmetic_expression.ink codegen
|
test/assign_arithmetic_expression.ink codegen
|
||||||
test/basic_property_and_return_value.ink codegen
|
test/basic_property_and_return_value.ink codegen
|
||||||
|
test/builtin_types.ink codegen
|
||||||
test/complicated_computation.ink codegen
|
test/complicated_computation.ink codegen
|
||||||
test/constant_buffer.ink codegen
|
test/constant_buffer.ink codegen
|
||||||
test/empty_struct.ink codegen
|
test/empty_struct.ink codegen
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
test/assign_arithmetic_expression.ink compile
|
test/assign_arithmetic_expression.ink compile
|
||||||
test/basic_property_and_return_value.ink compile
|
test/basic_property_and_return_value.ink compile
|
||||||
|
test/builtin_types.ink compile
|
||||||
test/complicated_computation.ink compile
|
test/complicated_computation.ink compile
|
||||||
test/empty_struct.ink compile
|
test/empty_struct.ink compile
|
||||||
test/empty_vertex_main.ink compile
|
test/empty_vertex_main.ink compile
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
test/assign_arithmetic_expression.ink lex
|
test/assign_arithmetic_expression.ink lex
|
||||||
test/basic_property_and_return_value.ink lex
|
test/basic_property_and_return_value.ink lex
|
||||||
|
test/builtin_types.ink lex
|
||||||
test/complicated_computation.ink lex
|
test/complicated_computation.ink lex
|
||||||
test/constant_buffer.ink lex
|
test/constant_buffer.ink lex
|
||||||
test/else_if_after_else.ink lex
|
test/else_if_after_else.ink lex
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
test/assign_arithmetic_expression.ink parse
|
test/assign_arithmetic_expression.ink parse
|
||||||
test/basic_property_and_return_value.ink parse
|
test/basic_property_and_return_value.ink parse
|
||||||
|
test/builtin_types.ink parse
|
||||||
test/complicated_computation.ink parse
|
test/complicated_computation.ink parse
|
||||||
test/constant_buffer.ink parse
|
test/constant_buffer.ink parse
|
||||||
test/else_if_after_else.ink parse
|
test/else_if_after_else.ink parse
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
test/assign_arithmetic_expression.ink semant
|
test/assign_arithmetic_expression.ink semant
|
||||||
test/basic_property_and_return_value.ink semant
|
test/basic_property_and_return_value.ink semant
|
||||||
|
test/builtin_types.ink semant
|
||||||
test/complicated_computation.ink semant
|
test/complicated_computation.ink semant
|
||||||
test/constant_buffer.ink semant
|
test/constant_buffer.ink semant
|
||||||
test/empty_struct.ink semant
|
test/empty_struct.ink semant
|
||||||
@@ -8,7 +9,6 @@ test/empty_vertex_main.ink semant
|
|||||||
test/empty_vertex_main_with_position_parameter.ink semant
|
test/empty_vertex_main_with_position_parameter.ink semant
|
||||||
test/field_assignment.ink semant
|
test/field_assignment.ink semant
|
||||||
test/for_i_loop.ink semant
|
test/for_i_loop.ink semant
|
||||||
test/for_i_one_liner.ink semant
|
|
||||||
test/function_call.ink semant
|
test/function_call.ink semant
|
||||||
test/function_call_out_of_order_declaration.ink semant
|
test/function_call_out_of_order_declaration.ink semant
|
||||||
test/function_call_return.ink semant
|
test/function_call_return.ink semant
|
||||||
|
|||||||
Reference in New Issue
Block a user