mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
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:
parent
ed71f4f0de
commit
b8ed7225c0
1 changed files with 2 additions and 7 deletions
|
@ -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; \
|
||||
|
|
Loading…
Add table
Reference in a new issue