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:
kr.angelov
2014-10-08 12:57:29 +00:00
parent 67781996b6
commit 9c2f71b07a
6 changed files with 90 additions and 59 deletions

View File

@@ -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);