diff options
Diffstat (limited to 'proc.c')
| -rw-r--r-- | proc.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -3,6 +3,20 @@ /* procedures */ +/* the tangle of arenas here will need to be sorted out eventually: currently + * we have two arenas for every single procedure, a permanent one lasting the + * full length of compilation, and a scratch arena reset after every statement. + * so, long-lasting node data and very temporary allocations. + * + * this works fine when there's just one procedure, but long-term there should + * be a couple arenas per _worker thread_, not per procedure. and for this, + * there's a third kind of data --- stuff that lasts the length of parsing one + * procedure, but no longer; scope information, mainly. + * + * so in the end we might have like + * _Thread_local Arena graph_arena, scratch_arena, parse_arena; + */ + void proc_init(Proc *proc, Str name) { memset(proc, 0, sizeof(Proc)); Graph *g = &proc->graph; |
