2a10 Memory allocation caused by array-to-list conversion

Lazlo Bonin (Lead Developer) 7 months ago updated 7 months ago 2

The Bolt 1 design choices of automatic enumerable-to-list and enumerable-to-array conversions can easily lead to avoidable memory allocation in Bolt 2, as well as unclear indication that we are working on a copy of the original collection. 

Solutions to consider:

  • Removing these conversions (which may break Bolt 1 legacy graphs)
  • Native support for array units (more work but proper solution)
  • Intermediary solution of casting arrays to IList<T> under the hood (maybe using an automatic conversion) and using those strongly typed methods directly, until we have native array support. This would imply exposing/adding IList<T> to the default types, which may add confusion for non-technical users.
Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Bolt 2