Issue #142 - Statically allocate closure0

Statically allocate closure0 objects since they are immutable and contain no free variables, so all copies of them would be identical.
This commit is contained in:
Justin Ethier 2017-07-27 18:59:46 -04:00
parent ed71f4f0de
commit b8ed7225c0

View file

@ -1002,13 +1002,8 @@ typedef closure0_type *macro;
c.fn = f; \
c.num_args = -1;
#define mclosure0(c,f) \
closure0_type c; \
c.hdr.mark = gc_color_red; \
c.hdr.grayed = 0; \
c.tag = closure0_tag; \
c.fn = f; \
c.num_args = -1;
#define mclosure0(c, f) \
static closure0_type c = { .hdr.mark = gc_color_red, .hdr.grayed = 0, .tag = closure0_tag, .fn = f, .num_args = -1 }; /* TODO: need a new macro that initializes num_args */
#define mclosure1(c,f,a) \
closure1_type c; \