Opened 5 years ago

Closed 2 years ago

#4074 closed defect (fixed)

Singleton for empty List & Opt

Reported by: Jesper Mattsson Owned by: Jesper Mattsson
Priority: major Milestone: Pending
Component: Modelica/FrontEnd Version: trunk
Keywords: #2031. Cc:


Empty List and Opt nodes are very common in typical trees generated by the compiler. If we replace them with singletons (something like List.EMPTY and Opt.EMPTY), then we can save a significant amount of memory for large models. To be safe to use, the singletons should be special subclasses of List & Opt that throw exceptions for all operations that change them (e.g. adding children) and getParent (since parent would point to the last one it was added to.

This is a part of #2031.

Change History (1)

comment:1 Changed 2 years ago by Jesper Mattsson

Resolution: fixed
Status: newclosed

Now handled by JastAdd.

Note: See TracTickets for help on using tickets.