Commits

Doug Gregor committed 2183b57fa4a
Introduce a special memory arena in ASTContext for the type checker. This introduces the notion of arenas into ASTContext, with two arenas currently defined: one for 'permanent' storage, and another for the current constraint checker. The latter is used when allocating any types that involve type variables, which are only used temporarily during type checking anyway. This gives us a 1% speedup on swift.swift (because we're hitting smaller hash tables when doing lookups) and < 1% memory reduction (since that's not the main source of memory usage). It's more important architecturally, so our memory usage doesn't grow with the number of type-checks performed. Note also that this arena scheme could be generalized, which we may very well want to do in the future. For example, we could easily have an arena for temporary nodes introduced by parsing (e.g., UnresolvedDeclRefExpr) or by name binding (OverloadedDeclRefExpr), and clear that arena when we successfully move onto the next phase. Or, in a REPL/debugger context, have a 'temporary' arena for statements/expressions that can be removed. Swift SVN r3175