mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-03 00:02:50 -06:00
now we statically allocate closures for all top-level functions and all nullary constructors. closures are dynamically allocated only for CAFs. this reduces memory use and time to allocate dynamic closures
This commit is contained in:
@@ -442,7 +442,12 @@ pgf_read_absfun(PgfReader* rdr, PgfAbstr* abstr)
|
||||
switch (tag) {
|
||||
case 0:
|
||||
absfun->defns = NULL;
|
||||
absfun->closure_id = 0;
|
||||
if (absfun->arity == 0) {
|
||||
absfun->closure.code = abstr->eval_gates->evaluate_value;
|
||||
absfun->closure.con = &absfun->closure.code;
|
||||
} else {
|
||||
absfun->closure.code = NULL;
|
||||
}
|
||||
break;
|
||||
case 1: {
|
||||
GuLength length = pgf_read_len(rdr);
|
||||
|
||||
Reference in New Issue
Block a user