Open gmbecker opened 1 year ago
This sounds like a long-term project. Given the amount of code that keeps the pointers returned by install() forever, there will probably be need for separate API for creating "perishable" symbols, and the old-style API will have to promote such symbols to keep them from being discarded if it locates and has to return such a symbol.
Yes there will need to be a separate interface for creating transient symbols, and an efficient way to distinguish whether a symbol is permanent or transient (probably a bit in sxpinfo.gp).
The main places where transient symbols can be created are in the parser for new symbols in RR code, the as.name
implementation, and for tags in attributes. There are probably other places as well, but they don't need to be identified all at once.
Endorsed by Luke
Currently symbols are never garbage collected. Some usage patterns create many symbols that are no longer needed after a computation, but will never be reclaimed. It should be possible to modify the GC to remove symbols no longer referenced from the symbol table.