mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 03:09:33 -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:
@@ -69,6 +69,8 @@ typedef struct {
|
||||
|
||||
typedef GuSeq PgfEquations;
|
||||
|
||||
typedef void *PgfFunction;
|
||||
|
||||
typedef struct {
|
||||
PgfCId name;
|
||||
PgfType* type;
|
||||
@@ -76,7 +78,13 @@ typedef struct {
|
||||
PgfEquations* defns; // maybe null
|
||||
PgfExprProb ep;
|
||||
void* predicate;
|
||||
size_t closure_id;
|
||||
struct {
|
||||
PgfFunction code;
|
||||
union {
|
||||
size_t caf_offset;
|
||||
PgfFunction* con;
|
||||
};
|
||||
} closure;
|
||||
} PgfAbsFun;
|
||||
|
||||
extern GU_DECLARE_TYPE(PgfAbsFun, abstract);
|
||||
|
||||
Reference in New Issue
Block a user