From 9c2f71b07a5de7d6d4d13dc3c72d9b9ddc2f37dc Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 8 Oct 2014 12:57:29 +0000 Subject: 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 --- src/runtime/c/pgf/data.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/runtime/c/pgf/data.h') 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); -- cgit v1.2.3