mangolang/compiler

Arena allocations

Opened this issue · 1 comments

There are three things to consider:

  1. The total required size of an arena should be known beforehand.
  2. All the data in an arena should be cleaned up at the same time.
  3. It may impact multithreading (either not sync, or too many atomic operations).

For #1, while its impossible to know the amount of memory required, it is acceptable to use multiple arena's.
For #2, this should be easy, as most things are needed until the end of compilation.
For #3, this remains an open issue, but can be delayed until multi-threading is actually added.

This could be combined with flyweight, maybe.