Re: Garbage and macros
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Feb 16, 1998
- 617 views
Rob Craig wrote: >> If you need to save space, it may help to set a large sequence >> to {} when you no longer need it's value, but remember that >> Euphoria will automatically free all the private variables of a routine >> when that routine returns. Whenever you assign a new value to >> a variable, any space used by the previous value is recycled. Daniel Johnson asks: > If it is in the main program code, would it be unrealistic to > expect the interpreter to figure out that the variable is > not used again ? It would be > nice to have memory matters taken completely off our hands, > as this is one of the things Euphoria boasts about > eg dynamic resizing and reformatting. It's theoretically impossible for any language compiler to *always* know if a variable will be used again, but it is possible in certain *limited* cases, using something called "data flow" analysis. I implemented data flow analysis in another compiler I developed a several years ago, but I'm not sure if or when I will do it for Euphoria. Regards, Rob Craig Rapid Deployment Software