summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/data.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-10-08 12:57:29 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-10-08 12:57:29 +0000
commit9c2f71b07a5de7d6d4d13dc3c72d9b9ddc2f37dc (patch)
treecc468098d8b2f567121b860662311b9eb8d18492 /src/runtime/c/pgf/data.h
parent67781996b639e9c31acd4a25b229222139686f07 (diff)
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
Diffstat (limited to 'src/runtime/c/pgf/data.h')
-rw-r--r--src/runtime/c/pgf/data.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h
index 4f1f66a3b..ac319c59f 100644
--- a/src/runtime/c/pgf/data.h
+++ b/src/runtime/c/pgf/data.h
@@ -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);