Minimize memory usage for AST nodes by using Slice<T> rather than Array<T> when the parameter doesn't need to grow

This commit is contained in:
gingerBill
2020-11-16 15:18:25 +00:00
parent adf6c85fd3
commit ca4b0527e8
12 changed files with 218 additions and 119 deletions

View File

@@ -113,7 +113,7 @@ Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *operand, Stri
return e->type;
}
void check_init_variables(CheckerContext *ctx, Entity **lhs, isize lhs_count, Array<Ast *> const &inits, String context_name) {
void check_init_variables(CheckerContext *ctx, Entity **lhs, isize lhs_count, Slice<Ast *> const &inits, String context_name) {
if ((lhs == nullptr || lhs_count == 0) && inits.count == 0) {
return;
}