Use a cache when generating the map header to minimize stack wastage

This commit is contained in:
gingerBill
2022-09-17 12:56:03 +01:00
parent 7840c1b89f
commit 0ebc2add03
3 changed files with 51 additions and 39 deletions

View File

@@ -121,8 +121,9 @@ lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool ignore_body)
p->branch_blocks.allocator = a;
p->context_stack.allocator = a;
p->scope_stack.allocator = a;
map_init(&p->selector_values, a, 0);
map_init(&p->selector_addr, a, 0);
map_init(&p->selector_values, a, 0);
map_init(&p->selector_addr, a, 0);
map_init(&p->map_header_cache, a, 0);
if (p->is_foreign) {
lb_add_foreign_library_path(p->module, entity->Procedure.foreign_library);