diff options
| author | WormHeamer | 2025-08-31 01:42:04 -0400 |
|---|---|---|
| committer | WormHeamer | 2025-08-31 01:42:04 -0400 |
| commit | 36c9dd221a25dc741e6f5844ff7cdc87f6f6c946 (patch) | |
| tree | 3cefaffb61e4bb0cbbd11a0d90e42ce51987d67a /proc.c | |
| parent | cbca8b454309122632615f0bcb787bc898503df9 (diff) | |
thoughts about arenas
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; |
